[issue27359] OrderedDict pseudo-literals (WIP)

2017-11-05 Thread Stefan Krah
Stefan Krah added the comment: It looks like guaranteed ordered literals are going to happen (yay!): https://mail.python.org/pipermail/python-dev/2017-November/150144.html -- nosy: +skrah resolution: later -> out of date stage: -> resolved status: open -> closed type: -> enhanceme

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: FYI the proposition about OrderedDict literals was raised on Python-Ideas or Python-Dev multiple times. http://comments.gmane.org/gmane.comp.python.ideas/4888 http://comments.gmane.org/gmane.comp.python.ideas/6569 http://comments.gmane.org/gmane.comp.python.d

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: No worries, it just seemed a little brash ;-) Go ahead and continue to post patch variants here. Once it's working, going to python-dev is the right thing to do (to see whether it meets a threshold of need and to endlessly debate what the syntax would be).

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Joe Jevnik
Joe Jevnik added the comment: Sorry about undoing the settings, that was unintentional. The UI around these settings is sort of unintuitive. I was waiting to propose this on python-dev until I got it working, but I wanted to push up what I did have as a work in progress so I could try to get

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: One other thought is that the threshold for syntax changes to the language should be very high and should benefit the many, many who use Python, not just ourselves for something that might have been a little more convenient for a particular use. We've nev

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: BTW, there's no way this particular syntax suggestion is going in without a discussion on python-dev. I think the square brackets will be a non-starter. -- assignee: -> rhettinger resolution: -> later status: open -> pending _

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Joe Jevnik
Joe Jevnik added the comment: Assuming all dicts are ordered, there will be no need for this (as long as the parser preserves order) so I am okay with dropping this. One of the main use cases I have for wanting nice literals is when I am working on tests. I find it very nice to be able to writ

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: This needs to tabled pending the outcome of the python-dev discussion to make all dicts ordered dictionaries. If it does get revived, there need to be clear motivating use cases. In most of the use cases I've seen for ordered dicts, the key/value pairs are

[issue27359] OrderedDict pseudo-literals (WIP)

2016-06-20 Thread Joe Jevnik
New submission from Joe Jevnik: This proposes the following syntax for creating OrderedDict literals: OrderedDict[k1: v1, k2: v2, ...] This is implemented by putting a metaclass on OrderedDict which has a getitem that turns the slices into a list of tuples (after validation). The idea is take