diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-01-31 08:59:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-31 08:59:50 (GMT) |
commit | 0bb4bdf0d93b301407774c4ffd6df54cff947df8 (patch) | |
tree | 174cc59b599a8f9aa223eb0f24c90fccb5e8701f /Doc/whatsnew | |
parent | 0897e0c597c065f043e4286d01f16f473ab664ee (diff) | |
download | cpython-0bb4bdf0d93b301407774c4ffd6df54cff947df8.zip cpython-0bb4bdf0d93b301407774c4ffd6df54cff947df8.tar.gz cpython-0bb4bdf0d93b301407774c4ffd6df54cff947df8.tar.bz2 |
bpo-35864: Replace OrderedDict with regular dict in namedtuple() (#11708)
* Change from OrderedDict to a regular dict
* Add blurb
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.8.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index fb25ce2..09c43b1 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -125,6 +125,14 @@ New Modules Improved Modules ================ +* The :meth:`_asdict()` method for :func:`collections.namedtuple` now returns + a :class:`dict` instead of a :class:`collections.OrderedDict`. This works because + regular dicts have guaranteed ordering in since Python 3.7. If the extra + features of :class:`OrderedDict` are required, the suggested remediation is + to cast the result to the desired type: ``OrderedDict(nt._asdict())``. + (Contributed by Raymond Hettinger in :issue:`35864`.) + + asyncio ------- |