[issue36320] typing.NamedTuple to switch from OrderedDict to regular dict

Raymond Hettinger report at bugs.python.org
Sat Mar 16 16:10:01 EDT 2019


New submission from Raymond Hettinger <raymond.hettinger at gmail.com>:

Suggestions:
* Deprecate _field_types in favor of __annotations__.
* Convert __annotations__ from OrderedDict to a regular dict.

This will make the API cleaner. The first one will also remove a difference between NamedTuple and namedtuple().  The second is consistent with the decision to convert _asdict() to a regular dictionary since OrderedDict is no longer necessary or desirable. The second will also make the signature of __annotations__ match that from other classes.

----------
assignee: levkivskyi
components: Library (Lib)
messages: 338095
nosy: levkivskyi, rhettinger
priority: normal
severity: normal
status: open
title: typing.NamedTuple to switch from OrderedDict to regular dict
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36320>
_______________________________________


More information about the Python-bugs-list mailing list