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 <>
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.”
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: <>
2017-01-19 21:10:46martin.panterlinkissue29311 messages
2017-01-19 21:10:46martin.pantercreate