Re: [Python-Dev] PEP 457: Syntax For Positional-Only Parameters

2013年10月09日 00:47:14 -0700

On 10/09/2013 03:57 AM, Joao S. O. Bueno wrote:
def a([b],/,**kw):
 print (b)
does calling "a(b=5)" should raise a TypeError, or put "5" in
"""kw["b"]""" and leave
"b" as "undefined" ?
The latter. This is how they are "similarly to *args and **kwargs":
 >>> def foo(*a, **kw):
 ... print(a, kw)
 ...
 >>> foo(a=3, kw=5)
 () {'kw': 5, 'a': 3}
 >>>
//arry/
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to