Bug or not ?

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Fri May 4 16:20:21 EDT 2001


Sat, 05 May 2001 05:21:14 +0930, PoD <pod at internode.on.net> pisze:

> Is there a reason for the current behaviour being desirable?
> [[0]*height]*width seems like an obvious way to make a 2D array.

list*number repeats elements of the list, but it doesn't make deep
copies of them. Deep copying is rarely needed, hard to define and
inefficient. It never happens by default - it's a long library
function, not a natural primitive operation. Usually the amount of
copying is coded explicitly, with rebinding references elsewhere.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list