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.

Author martin.panter
Recipients larry, martin.panter, methane, python-dev, serhiy.storchaka, vstinner
Date 2017-01-19.21:10:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484860246.54.0.426160578362.issue29311@psf.upfronthosting.co.za>
In-reply-to
Content
D.get(key[, default]) -> D[key] if key in D, else default.

There is no big problem with that. D is defined at the start. The only thing I would have suggested is avoid using square brackets to mean two things in the one expression. Since it is no longer the signature, calling with both parameters should be okay:

'''
get($self, key, default=None, /)
--
D.get(key, default) -> D[key] if key in D, else default.
'''

However the other method no longer defines D:

'''
setdefault($self, key, default=None, /)
--
D.get(key,default), also set D[key]=default if key not in D.
'''

You could restore the initial text as “D.setdefault(key,default) ->”, or maybe rewrite it like

“Like get(), but also insert the default value if it is missing.”
History
Date User Action Args
2017-01-19 21:10:46martin.pantersetrecipients: + martin.panter, vstinner, larry, methane, python-dev, serhiy.storchaka
2017-01-19 21:10:46martin.pantersetmessageid: <1484860246.54.0.426160578362.issue29311@psf.upfronthosting.co.za>
2017-01-19 21:10:46martin.panterlinkissue29311 messages
2017-01-19 21:10:46martin.pantercreate