Todd Weiler twei...@raggedcreek.com added the comment:
Let me defend my idea a little bit.
Some people hand code their UI's, some people put them into XML UI files
then load those files.
I'd like to create them using an OrderedDict. I'm using the pyQT for a gui.
Attached is a really simple
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
The proposal for a custom syntax has nearly zero chance of success.
FWIW, the JSON module provides an alternative way to get a the same
result using the new object_pairs_hook (being added to Py2.7 and Py3.1).
--
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
For this usage I'd suggest a class.
See http://www.python.org/dev/peps/pep-3115/ the example
containing OrderedClass.
With a little work, your code could look like:
class Interface(TabbedPane):
class FirstTab(Pane):
label =
Georg Brandl ge...@python.org added the comment:
I don't think this is going to fly -- 1. because we don't lightly add
new syntax for every data type and 2. because it doesn't scale beyond
simple keys and values. A list of tuples is explicit and works fine.
--
nosy: +georg.brandl
New submission from Todd Weiler twei...@raggedcreek.com:
Now that python has an ordered dictionary it would be great to have a
display sytax for creating them.
To create a dict I just use the dict display syntax:
newdict = {'fred':'flintstone', 'barney':'rubble', 'dino':'thedinosaur'}
I'd like