[Python-3000] Metaclasses in Py3K

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Dec 19 02:54:20 CET 2006


Talin wrote:

> Do you have a specific proposal as to how the information about the 
> ordering of definitions could be extracted? I'm assuming that there 
> would be an extra attribute that would return a list of keys in the 
> order that they were defined.

An extra attribute or method would be one obvious way.

Another way would be to have the existing items() and
iteritems() methods return a list in the appropriate
order.

> One tricky part here is if the same key 
> were to be defined twice (i.e. being overwritten the second time), we 
> probably would only want it to appear once, probably at the location 
> where it was defined last.

That sounds reasonable, but if anyone wanted to argue
that both definitions should be preserved, I wouldn't
object.

--
Greg


More information about the Python-3000 mailing list