On Oct 28, 8:52 am, candide <cand...@free.invalid> wrote: > No but I'm expecting from Python documentation to mention the laws of > Python ...
It's not a "law", it's an _implementation detail_. The docs don't tend to mention every such decision made because that's what the source is for. > But beside this, how to recognise classes whose object doesn't have a > __dict__ attribute ? The better question is: why do you need to be able to? > Is it possible in the CPython implementation to write something like this : > "foo".bar = 42 > without raising an attribute error ? Why are you trying to modify an immutible object? If you really want to assign attributes to string objects, subclass str. -- http://mail.python.org/mailman/listinfo/python-list