Message243729
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. |
|
Date |
User |
Action |
Args |
2015-05-21 05:34:48 | eric.snow | set | recipients:
+ eric.snow, ncoghlan |
2015-05-21 05:34:48 | eric.snow | set | messageid: <1432186488.39.0.20621749373.issue24254@psf.upfronthosting.co.za> |
2015-05-21 05:34:48 | eric.snow | link | issue24254 messages |
2015-05-21 05:34:48 | eric.snow | create | |
|