10 Feb
2008
10 Feb
'08
2:34 a.m.
On Feb 9, 2008 5:22 PM, Raymond Hettinger
Perhaps, the dict() constructor should accept any object with a __dict__ method.
Won't that interfere with the existing __dict__ *attribute* of most objects (e.g. modules)?
The principle is that almost any object that has key and value pairs (named tuples for example) should be readily convertable to and from a dictionary. The current, non-uniform alternative is for the object to provide an asdict() method and for the user to call it directly.
-- --Guido van Rossum (home page: http://www.python.org/~guido/)