Issue 29072: the message of help(os.environ.setdefault) have some error (original) (raw)

Issue29072

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.
History
Date User Action Args
2022-04-11 14:58:41 admin set github: 73258
2016-12-26 14:15:50 r.david.murray set status: open -> closednosy: + r.david.murraymessages: + resolution: not a bugstage: resolved
2016-12-26 08:53:33 劉劍峰 create