> > I think the syntax looks good, but as per a thread in python-list, you > > cannot discover the order of class variables by any solution (metaclass > > or otherwise), due to the fact that they become part of the class > > dictionary; which is arbitrarily unordered. > > > > If ordering is important to a user, one could have an optional > > __order__ > > attribute that gives the list of items in-order. > > That's not quite true. TypedAttribute instances and iniSection's > __new__ could have serial numbers. I'm not saying that they can't be numbered, I'm saying that one cannot discover the ordering of assignment of attr1 and attr2 in the following: class foo: attr1 = value1 attr2 = value2 If there is a mechanism for discovering the original ordering of those assignments, there are a group of users in c.l.py who would like to know, and Carlos' seemingly non-existant implementation could also use it. Please advise, - Josiah
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4