Issue 31252: Operator.itemgetter documentation should include dictionary keys example (original) (raw)

Issue31252

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:51 admin set github: 75435
2017-09-08 06:53:54 rhettinger set status: open -> closedresolution: fixedstage: patch review -> resolved
2017-09-07 22:21:48 rhettinger set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest3428>
2017-08-22 03:32:07 rhettinger set versions: - Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6nosy: + rhettingermessages: + assignee: docs@python -> rhettinger
2017-08-21 19:02:17 ashishnitinpatil create