[Python-ideas] iterable.__unpack__ method

Nick Coghlan ncoghlan at gmail.com
Sun Feb 24 03:12:13 CET 2013


I definitely like Terry's idea of using ", ..." to say "and ignore the
rest". Simple, elegant and can be restricted to the last element so it
works with infinite iterators and large sequences. It also allows
incremental unpacking of ordinary iterators.

I still like the idea of an unpacking protocol as well, but the above would
cover a lot of use cases without needing a new protocol, and thus should be
considered first (since a new protocol is a higher impact change than
Terry's syntax suggestion).

Cheers,
Nick.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130224/5af02024/attachment.html>


More information about the Python-ideas mailing list