Tal Einat <talei...@gmail.com> added the comment:

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.

----------
nosy: +taleinat

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34235>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to