[Python-ideas] Re: Null wildcard in de-structuring to ignore remainder and stop iterating

2022-06-09 Thread Paul Moore
On Thu, 9 Jun 2022 at 01:12, Steve Jorgensen wrote: > > My current thinking in response to that is that using islice is a decent > solution except that it's not obvious. You have to jump outside of the > thinking about the destructuring capability and consider what else could be > used to help.

[Python-ideas] Re: Null wildcard in de-structuring to ignore remainder and stop iterating

2022-06-09 Thread Mathew Elman
would it not be possible to have slicing fallback to islice if __iter__ is implemented and __geitem__ is not? ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/m

[Python-ideas] Re: Null wildcard in de-structuring to ignore remainder and stop iterating

2022-06-09 Thread Rob Cliffe via Python-ideas
On 09/06/2022 09:50, Paul Moore wrote: On Thu, 9 Jun 2022 at 01:12, Steve Jorgensen wrote: My current thinking in response to that is that using islice is a decent solution except that it's not obvious. You have to jump outside of the thinking about the destructuring capability and conside

[Python-ideas] Re: Null wildcard in de-structuring to ignore remainder and stop iterating

2022-06-09 Thread Stephen J. Turnbull
Mathew Elman writes: > would it not be possible to have slicing fallback to islice if > __iter__ is implemented and __geitem__ is not? The syntax is well-defined, but the semantics are not. Consider "g[101]; g[100]" for g a generator object. This either requires all generators to keep a cache

[Python-ideas] Re: Null wildcard in de-structuring to ignore remainder and stop iterating

2022-06-09 Thread Paul Moore
> On 09/06/2022 09:50, Paul Moore wrote: > > On Thu, 9 Jun 2022 at 01:12, Steve Jorgensen wrote: > >> My current thinking in response to that is that using islice is a decent > >> solution except that it's not obvious. You have to jump outside of the > >> thinking about the destructuring capabil