On 2011.06.11 09:13 PM, Steven D'Aprano wrote:
> So never update from a random object you don't know well.
Of course. In the project I'm working on, this will be used in the
__init__() method of a class that accepts a pair of dictionaries or
possibly **kwargs (for flexibility and to avoid the very problem of an
object without a __dict__).
> A second, more subtle risk: not all objects have a __dict__. But if you 
> obey the rule about never updating from arbitrary objects you don't know, 
> then you won't be surprised by an object with no __dict__.
What objects don't (other than the obvious ones like strings,
dictionaries, ints and lists)?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to