This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients eric.snow, ncoghlan
Date 2015-05-21.05:34:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432186488.39.0.20621749373.issue24254@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a work-in-progress patch that uses OrderedDict as the default class definition namespace (instead of dict).  While the actual class namespace is a dict, the definition order is preserved on a new attribute on class objects: __definition_order__.  This is useful for cases such as class decorators that would make use of the definition order to post-process the class.  This is something that Guido okay'ed a while back.

It may be a stretch to get this into 3.5, but the final change should be pretty small.  It also depends on the C implementation of OrderedDict (see issue #16991) which has not landed and may not make it in time.

Note that the patch is still a bit buggy, partly due to bugs in the C OrderedDict patch.  Also, the attached patch is based off the C OrderedDict patch, so I expect reitveld won't be able to handle it.  The code on which the patch is based may be found in the "class-namespace" branch of https://pypi.python.org/pypi/cyordereddict.
History
Date User Action Args
2015-05-21 05:34:48eric.snowsetrecipients: + eric.snow, ncoghlan
2015-05-21 05:34:48eric.snowsetmessageid: <1432186488.39.0.20621749373.issue24254@psf.upfronthosting.co.za>
2015-05-21 05:34:48eric.snowlinkissue24254 messages
2015-05-21 05:34:48eric.snowcreate