On 24 May 2015 at 19:44, Mark Shannon <m...@hotpy.org> wrote:
> On 24/05/15 10:35, Nick Coghlan wrote:
>> If we leave __definition_order__ out for the time being then, for the
>> vast majority of code, the fact that the ephemeral namespace used to
>> evaluate the class body switched from being a basic dictionary to an
>> ordered one would be a hidden implementation detail, rather than
>> making all type objects a little bigger.
> and a little slower.

The runtime namespace used to store the class attributes is remaining
a plain dict object regardless, it's only the ephemeral one that's
used to evaluate the class body at definition time that Eric's
proposing to switch to an ordered dictionary.

That approach avoids any new runtime overhead when using the defined
class, while still making the order of attribute assignment available
to custom metaclasses by default.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to