[Python-3000] Best Practices essays

Josiah Carlson jcarlson at uci.edu
Fri Mar 24 09:26:50 CET 2006


"Edward C. Jones" <edcjones at comcast.net> wrote:
> That's a good idea. Include everything from m * [n * [0]] to pickling 

Except that it probably doesn't do what you intend...

    >>> a = 2*[3*[0]]
    >>> a
    [[0, 0, 0], [0, 0, 0]]
    >>> a[0][0] = 2
    >>> a
    [[2, 0, 0], [2, 0, 0]]

Unless you intend something like that...

 - Josiah



More information about the Python-3000 mailing list