mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-136327: Fix inconsistent `TypeError` messages regarding invalid values after * and ** (#136395)
This commit is contained in:
parent
b3c713a0af
commit
4f8e7b5ac5
4 changed files with 23 additions and 36 deletions
|
|
@ -137,7 +137,7 @@
|
|||
>>> g(*Nothing())
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: test.test_extcall.g() argument after * must be an iterable, not Nothing
|
||||
TypeError: Value after * must be an iterable, not Nothing
|
||||
|
||||
>>> class Nothing:
|
||||
... def __len__(self): return 5
|
||||
|
|
@ -146,7 +146,7 @@
|
|||
>>> g(*Nothing())
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: test.test_extcall.g() argument after * must be an iterable, not Nothing
|
||||
TypeError: Value after * must be an iterable, not Nothing
|
||||
|
||||
>>> class Nothing():
|
||||
... def __len__(self): return 5
|
||||
|
|
@ -266,7 +266,7 @@
|
|||
>>> h(*h)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: test.test_extcall.h() argument after * must be an iterable, not function
|
||||
TypeError: Value after * must be an iterable, not function
|
||||
|
||||
>>> h(1, *h)
|
||||
Traceback (most recent call last):
|
||||
|
|
@ -281,55 +281,53 @@
|
|||
>>> dir(*h)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: dir() argument after * must be an iterable, not function
|
||||
TypeError: Value after * must be an iterable, not function
|
||||
|
||||
>>> nothing = None
|
||||
>>> nothing(*h)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: None argument after * must be an iterable, \
|
||||
not function
|
||||
TypeError: Value after * must be an iterable, not function
|
||||
|
||||
>>> h(**h)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: test.test_extcall.h() argument after ** must be a mapping, not function
|
||||
TypeError: Value after ** must be a mapping, not function
|
||||
|
||||
>>> h(**[])
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: test.test_extcall.h() argument after ** must be a mapping, not list
|
||||
TypeError: Value after ** must be a mapping, not list
|
||||
|
||||
>>> h(a=1, **h)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: test.test_extcall.h() argument after ** must be a mapping, not function
|
||||
TypeError: Value after ** must be a mapping, not function
|
||||
|
||||
>>> h(a=1, **[])
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: test.test_extcall.h() argument after ** must be a mapping, not list
|
||||
TypeError: Value after ** must be a mapping, not list
|
||||
|
||||
>>> h(**{'a': 1}, **h)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: test.test_extcall.h() argument after ** must be a mapping, not function
|
||||
TypeError: Value after ** must be a mapping, not function
|
||||
|
||||
>>> h(**{'a': 1}, **[])
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: test.test_extcall.h() argument after ** must be a mapping, not list
|
||||
TypeError: Value after ** must be a mapping, not list
|
||||
|
||||
>>> dir(**h)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: dir() argument after ** must be a mapping, not function
|
||||
TypeError: Value after ** must be a mapping, not function
|
||||
|
||||
>>> nothing(**h)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: None argument after ** must be a mapping, \
|
||||
not function
|
||||
TypeError: Value after ** must be a mapping, not function
|
||||
|
||||
>>> dir(b=1, **{'b': 1})
|
||||
Traceback (most recent call last):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue