[issue27359] OrderedDict pseudo-literals (WIP)
Joe Jevnik
report at bugs.python.org
Mon Jun 20 22:17:07 EDT 2016
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 taken from the library datashape where we have done this to implement pseudo literals for the Record type.
This is marked as WIP because I am not quite sure why, but this patch is causing subclasses of OrderedDict to segfault in PyObject_SetItem.
----------
components: Library (Lib)
files: odict_literals.patch
keywords: patch
messages: 268954
nosy: llllllllll
priority: normal
severity: normal
status: open
title: OrderedDict pseudo-literals (WIP)
versions: Python 3.6
Added file: http://bugs.python.org/file43495/odict_literals.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27359>
_______________________________________
More information about the Python-bugs-list
mailing list