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.

Title: the message of help(os.environ.setdefault) have some error
Type: Stage: resolved
Components: Documentation Versions: Python 3.5
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, r.david.murray, 劉劍峰
Priority: normal Keywords:

Created on 2016-12-26 08:53 by 劉劍峰, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg284015 - (view) Author: 劉劍峰 (劉劍峰) Date: 2016-12-26 08:53
the message `D.setdefault(k[,d])', compiler inform SyntaxError: invalid syntax. I think that it woulld be D.setdefault([k, d]).
msg284031 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-12-26 14:15
The documented syntax is correct.  The '[]' are part of the syntax *specification*, not the syntax itself.  They indicate an optional argument, just as they do in most syntax diagrams.
Date User Action Args
2022-04-11 14:58:41adminsetgithub: 73258
2016-12-26 14:15:50r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg284031

resolution: not a bug
stage: resolved
2016-12-26 08:53:33劉劍峰create