May be the first thing which I should do is to improve my English:) My main
point was that in many cases
(in my experience) it is a waste of memory to store entire list for star
variable (*b) instead of some kind
of iterator or deferred evaluation.

How do you defer evaluating the second and subsequent items if you
> evaluate the final two? Given:
>
> def gen():
>     yield 999
>     for i in range(100):
>         yield random.random()
>     yield 999
>     yield 999
>
> then
>
> a, ?*b, c, d = gen()


If I can not copy at Python level, I can 'tee' when 'star_pos' is reached.

In my usual practice, the main use that I encounter when see an assignment
to a star variable is as a storage
which is used only if the other vars match some criterion.

With kind regards, -gdg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to