[Python-ideas] Syntax for making stuct / record / namedtuples

Nick Coghlan ncoghlan at gmail.com
Wed Oct 21 13:55:50 CEST 2009


Eero Nevalainen wrote:
> Does this seem familiar or useful to anyone besides me?

Python 3, metaclasses and __prepare__ (aka PEP 3115).

The performance of the local function namespace is critical to Python's
speed characteristics, so slowing it down would not be appreciated (and
odicts definitely *are* slower than regular dicts due to the extra
checks involved).

The performance of class namespaces during definition is much less
critical however, and OrderedDict was added in part so that people could
easily return it from __prepare__ methods without having to write one
themselves.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------



More information about the Python-ideas mailing list