[Tutor] Confused about __setitem__

Kent Johnson kent37 at tds.net
Thu Dec 4 12:39:08 CET 2008


On Thu, Dec 4, 2008 at 3:54 AM, Alan Gauld <alan.gauld at btinternet.com> wrote:

> These are all class level variables so they will be shared if you
> create more than one instance of the class. That's probably
> not what you want?. You should initialise them inside an __init__
> method if you want each square to have its own values.

And likewise for the board variables.

Kent


More information about the Tutor mailing list