[Python-ideas] Star assignment in iterator way?
Kirill Balunov
kirillbalunov at gmail.com
Tue Nov 21 04:27:32 EST 2017
> Your implementation iterates seq multiple times. But iterable unpacking
> syntax works with an arbitrary iterable, and iterates it only once.
>
Oh sorry, I know that my implementation iterates seq multiple times, I only
provide this to show the idea. It can be much optimized at C level. I just
want to understand if it's worth the time and effort.
> Changing the result of iterable unpacking will break existing code that
> depends on the result been a list.
>
Backward compatibility is an important issue, but at the same time it is
the main brake on progress.
> And you already have mentioned a question about mutable sequence.
>
> If these conditions and restrictions suit you, you can use your
> good_star_exp() in your code or share it with others. But the semantic of
> iterable unpacking can't be changed.
>
And how do you look at something like this (deferred star evaluation)?:
a, ?*b, c, d = something_iterable
With kind regards, -gdg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171121/322e7129/attachment.html>
More information about the Python-ideas
mailing list