[prev in list] [next in list] [prev in thread] [next in thread]
List: python-ideas
Subject: [Python-ideas] Re: Fwd: Re: PEP 472 - slices in keyword indices, d[x=1:3]
From: Todd <toddrjen () gmail ! com>
Date: 2020-08-25 11:57:30
Message-ID: CAFpSVp+Zczp9s2_dSCxxNy0zTBvua9j9e99raYnqjY_rps_QXQ () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
On Tue, Aug 25, 2020, 05:10 Steven D'Aprano <steve@pearwood.info> wrote:
> I attempted to send this yesterday, but used the wrong sender email
> address and it got rejected.
>
> I think this is still relevent, just to confirm I understand the
> proposal correctly.
>
>
> ----- Forwarded message from Steven D'Aprano <steve+python@pearwood.info>
> -----
>
> Date: Mon, 24 Aug 2020 11:46:02 +1000
> From: Steven D'Aprano <steve+python@pearwood.info>
> To: python-ideas@python.org
> Subject: Re: [Python-ideas] PEP 472 - slices in keyword indices, d[x=1:3]
>
> On Sun, Aug 23, 2020 at 09:40:53PM -0400, Todd wrote:
>
> > I think it is worth directly discussing the availability of slices in PEP
> > 472-style keyword indices, since we seem to have mostly converged on a
> > dunder method signature. This is an issue that has been alluded to
> > regarding keyword-based (labelled) indices but not directly addressed.
> The
> > basic syntax would be something like d[x=1:3].
>
> I read that as equivalent to `d[x=slice(1, 3)]`. Is that your intention?
>
> If that is your intention, then a big +1.
>
Yes, this was my intention. The same as with current slices, just passed
to the keyword argument.
>
[Attachment #5 (text/html)]
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 25, \
2020, 05:10 Steven D'Aprano <<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>> \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">I attempted to send this yesterday, but used the wrong sender email <br> address \
and it got rejected.<br> <br>
I think this is still relevent, just to confirm I understand the <br>
proposal correctly.<br>
<br>
<br>
----- Forwarded message from Steven D'Aprano <<a href="mailto:steve%2Bpython@pearwood.info" \
target="_blank" rel="noreferrer">steve+python@pearwood.info</a>> -----<br> <br>
Date: Mon, 24 Aug 2020 11:46:02 +1000<br>
From: Steven D'Aprano <<a href="mailto:steve%2Bpython@pearwood.info" target="_blank" \
rel="noreferrer">steve+python@pearwood.info</a>><br>
To: <a href="mailto:python-ideas@python.org" target="_blank" \
rel="noreferrer">python-ideas@python.org</a><br>
Subject: Re: [Python-ideas] PEP 472 - slices in keyword indices, d[x=1:3]<br>
<br>
On Sun, Aug 23, 2020 at 09:40:53PM -0400, Todd wrote:<br>
<br>
> I think it is worth directly discussing the availability of slices in PEP<br>
> 472-style keyword indices, since we seem to have mostly converged on a<br>
> dunder method signature. This is an issue that has been alluded to<br>
> regarding keyword-based (labelled) indices but not directly addressed. The<br>
> basic syntax would be something like d[x=1:3].<br>
<br>
I read that as equivalent to `d[x=slice(1, 3)]`. Is that your intention?<br>
<br>
If that is your intention, then a big +1.<br></blockquote></div></div><div dir="auto"><br></div><div \
dir="auto">Yes, this was my intention. The same as with current slices, just passed to the keyword \
argument.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 \
0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> </blockquote></div></div></div>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/SHL2QKEH6TV4AOY5E22N5GIQBZUDZ2ZS/
Code of Conduct: http://python.org/psf/codeofconduct/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic