[issue5579] Display for OrderedDict

2009-04-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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 = 'First Tab'

[issue5579] Display for OrderedDict

2009-04-06 Thread Raymond Hettinger
Raymond Hettinger 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). -- nosy: +rhettinger __

[issue5579] Display for OrderedDict

2009-04-06 Thread Todd Weiler
Todd Weiler 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 example program that crea

[issue5579] Display for OrderedDict

2009-04-05 Thread Georg Brandl
Georg Brandl 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 resolution: -> reject

[issue5579] Display for OrderedDict

2009-03-27 Thread Todd Weiler
New submission from Todd Weiler : 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 to be able to create an