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 taleinat
Recipients larry, msullivan, serhiy.storchaka, taleinat
Date 2019-06-08.18:34:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1560018860.46.0.744885958818.issue34235@roundup.psfhosted.org>
In-reply-to
Content
How about allowing '|' to be used again after '$'? Keyword arguments would be optional by default, but if there is a '|' after the '$', then those before it are required.

Examples:
"O|O$O|O" -- one required keyword arg and one optional one.
"O|O$OO" -- both keyword args are optional.
"O|O$|OO" -- both keyword args are optional.
"O|O$OO|" -- both keyword args are required.

Pros:
1. Backwards-compatible with current notation.
2. No additional characters used as sigils.
3. Similar meaning as existing use of '|' to separate required and optional args.
4. Same order as for Python function.

Cons:
1. Need to scan to the end of the format string to figure out whether keyword args are optional or required.
History
Date User Action Args
2019-06-08 18:34:20taleinatsetrecipients: + taleinat, larry, serhiy.storchaka, msullivan
2019-06-08 18:34:20taleinatsetmessageid: <1560018860.46.0.744885958818.issue34235@roundup.psfhosted.org>
2019-06-08 18:34:20taleinatlinkissue34235 messages
2019-06-08 18:34:20taleinatcreate