[New-bugs-announce] [issue31345] Backport docstring improvements to the C version of OrderedDict

Raymond Hettinger report at bugs.python.org
Mon Sep 4 19:06:40 EDT 2017


New submission from Raymond Hettinger:

The help() for collections.OrderedDict.popitem is not showing the default value of last=True.

----------- Prior versions are unhelpful ------------------
~/npython $ python3.6
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
>>> help(OrderedDict.popitem)
Help on method_descriptor:

popitem(...)
    od.popitem() -> (k, v), return and remove a (key, value) pair.
    Pairs are returned in LIFO order if last is true or FIFO order if false.


----------- Current version is helpful --------------------
$ ./python.exe
Python 3.7.0a0 (heads/master-dirty:b2d096bd2a, Sep  4 2017, 14:50:05)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
>>> help(OrderedDict.popitem)
Help on method_descriptor:

popitem(self, /, last=True)
    Remove and return a (key, value) pair from the dictionary.

    Pairs are returned in LIFO order if last is true or FIFO order if false.

----------
messages: 301280
nosy: eric.snow, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Backport docstring improvements to the C version of OrderedDict
type: enhancement
versions: Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31345>
_______________________________________


More information about the New-bugs-announce mailing list