OK, basically you're arguing that knowing the definition order of class
attributes is often useful when (ab)using Python for things like schema or
form definitions. There are a few ways to go about it:

1. A hack using a global creation counter
<https://github.com/GoogleCloudPlatform/datastore-ndb-python/blob/master/ndb/model.py#L888>
2. Metaclass with __prepare__
<https://docs.python.org/3/reference/datamodel.html#prepare>
3. PEP 520 <https://www.python.org/dev/peps/pep-0520/>
4a. Make all dicts OrderedDicts in CPython
<http://bugs.python.org/issue27350>
4b. Ditto in the language standard

If we can make the jump to (4b) soon enough I think we should skip PEP 520;
if not, I am still hemming and hawing about whether PEP 520 has enough
benefits over (2) to bother.

Sorry Eric for making this so hard. The better is so often the enemy of the
good. I am currently somewhere between -0 and +0 on PEP 520. I'm not sure
if the work on (4a) is going to bear fruit in time for the 3.6 feature
freeze <https://www.python.org/dev/peps/pep-0494/#schedule>; if it goes
well I think we should have a separate conversation (maybe even a PEP?)
about (4b). Maybe we should ask for feedback from the Jython developers?
(PyPy already has this IIUC, and IronPython
<https://github.com/IronLanguages/main> seems moribund?)

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
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