On Sat, 11 Jun 2011 21:28:40 -0500, Andrew Berg wrote: > On 2011.06.11 09:13 PM, Steven D'Aprano wrote:
>> 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)? namedtuple is another common example. In pure Python, objects created using __slots__ usually don't have a __dict__. Quite possibly C extension objects. There may be others. -- Steven -- http://mail.python.org/mailman/listinfo/python-list