Bug or not ?

Joshua Marshall jmarshal at mathworks.com
Fri May 4 16:04:09 EDT 2001


PoD <pod at internode.on.net> wrote:

> I was bitten by this one early on as well.
> Is there a reason for the current behaviour being desirable?
> [[0]*height]*width seems like an obvious way to make a 2D array.

Although this does have less-than-ideal semantics for some uses, I
still think it was the right decision.  The alternative would be to
have '*' do a deep-copy, which [in my opinion] would be more
surprising.



More information about the Python-list mailing list