[sage-support] Re: Mutable default arguments in __init__?

2008-02-10 Thread Simon King
Dear David, On Feb 10, 8:23 pm, David Harvey <[EMAIL PROTECTED]> wrote: > On Feb 10, 2008, at 2:13 PM, Simon King wrote: > > > {}. Moreover, a.Data and b.Data should be different objects, because > > "D={}" should create a *new* empty dictionary each time. > > No -- this is incorrect. The new dic

[sage-support] Re: Mutable default arguments in __init__?

2008-02-10 Thread David Harvey
On Feb 10, 2008, at 2:13 PM, Simon King wrote: > {}. Moreover, a.Data and b.Data should be different objects, because > "D={}" should create a *new* empty dictionary each time. No -- this is incorrect. The new dictionary is created when the interpreter *reads the class definition*. It happens