replacing __dict__ with an OrderedDict
Ian Kelly
ian.g.kelly at gmail.com
Fri Jan 6 11:06:02 EST 2012
More information about the Python-list mailing list
Fri Jan 6 11:06:02 EST 2012
- Previous message (by thread): replacing __dict__ with an OrderedDict
- Next message (by thread): replacing __dict__ with an OrderedDict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Jan 6, 2012 at 6:40 AM, Ulrich Eckhardt <ulrich.eckhardt at dominolaser.com> wrote: > Nonetheless, I'm still wondering if I could somehow replace the dict with an > OrderedDict. In Python 3, yes. This is pretty much the entire use case for the new __prepare__ method of metaclasses. See the "OrderedClass" example at: http://docs.python.org/py3k/reference/datamodel.html#special-method-names Cheers, Ian
- Previous message (by thread): replacing __dict__ with an OrderedDict
- Next message (by thread): replacing __dict__ with an OrderedDict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list