This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Operator.itemgetter documentation should include dictionary keys example
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: ashishnitinpatil, docs@python, rhettinger
Priority: normal Keywords: patch

Created on 2017-08-21 19:02 by ashishnitinpatil, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 3431 merged rhettinger, 2017-09-07 22:21
Messages (2)
msg300648 - (view) Author: Ashish Nitin Patil (ashishnitinpatil) * Date: 2017-08-21 19:02
Current documentation lacks the example of usage with dictionary keys.

e.g. `itemgetter('sample')({'sample': True, 'How about this': 'Nope'})`
msg300666 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-08-22 03:32
Yes, we can add a dictionary example.  I will likely split it into two lines for clarity.  Perhaps something like:

    >>> soldier = dict(rank='captain', name='dotterbart')
    >>> itemgetter('rank')(soldier)
    'captain'
History
Date User Action Args
2022-04-11 14:58:51adminsetgithub: 75435
2017-09-08 06:53:54rhettingersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-09-07 22:21:48rhettingersetkeywords: + patch
stage: patch review
pull_requests: + pull_request3428
2017-08-22 03:32:07rhettingersetversions: - Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6
nosy: + rhettinger

messages: + msg300666

assignee: docs@python -> rhettinger
2017-08-21 19:02:17ashishnitinpatilcreate