count keyword only arguments as part of the total

This commit is contained in:
Benjamin Peterson 2010-03-21 21:16:24 +00:00
parent f3b7a25a21
commit afcee8b78d
2 changed files with 8 additions and 2 deletions

View file

@ -280,6 +280,12 @@ The number of arguments passed in includes keywords:
Traceback (most recent call last):
...
TypeError: f() takes exactly 1 argument (5 given)
>>> def f(a, *, kw):
... pass
>>> f(6, 4, kw=4)
Traceback (most recent call last):
...
TypeError: f() takes exactly 2 arguments (3 given)
"""
import sys