[Python-Dev] issue with itertools leads the crash

Chris Angelico rosuav at gmail.com
Tue Apr 8 19:39:23 CEST 2014


On Wed, Apr 9, 2014 at 3:30 AM, Larry Hastings <larry at hastings.org> wrote:
> On 04/08/2014 12:50 PM, Chris Angelico wrote:
>
> It would be nice to have a simple notation that fetches what it needs
> and ignores any extras.
>
> a, b, c, * = x.split("-")
>
> Bomb if there aren't two hyphens in x, but if there are more, just
> take the first three and ignore the rest. Would work with infinite
> iterators quite happily.
>
>
> http://legacy.python.org/dev/peps/pep-0448/
>

Yes, there've been various proposals like that. The exact notation I'm
referring to here isn't mentioned in that PEP, but I know it's been
mentioned before.

ChrisA


More information about the Python-Dev mailing list