This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients benjamin.peterson, pitrou
Date 2011-08-16.23:20:01
SpamBayes Score 0.0012767815
Marked as misclassified No
Message-id <1313536674.3531.3.camel@localhost.localdomain>
In-reply-to <1313536608.32.0.534168910193.issue12766@psf.upfronthosting.co.za>
Content
> So would you prefer to see
> 
> >>> x.foo
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> AttributeError: foo
> >>> x.foo = 5
> >>> x.foo
> 5
> ?

No, I would prefer to see

True
>>> x.foo = 5
>>> x.foo
5

... exactly as in the same class without a __slots__

(the whole point of class attributes being to set default values without
complicating the constructor)
History
Date User Action Args
2011-08-16 23:20:01pitrousetrecipients: + pitrou, benjamin.peterson
2011-08-16 23:20:01pitroulinkissue12766 messages
2011-08-16 23:20:01pitroucreate