[Python-ideas] Proposal to change List Sequence Repetition (*) so it is not useless for Mutable Objects

Matthew Tanous mtanous22 at gmail.com
Wed Jun 1 02:50:18 EDT 2016


I could see the use of the operator '@' to construct a matrix, perhaps.
It is more limited though (essentially a 2D version of sequence
repetition). 

Semantically, it would seem to me intuitive that [Foo()] *
N would create a list of N Foos, not a list of N references to the same
Foo. I can see that people who are used to how it actually works now
would have issues with such a change in the semantics, however. Didn't
consider the zip(*[it]*3) case being broken, I admit.



More information about the Python-ideas mailing list