diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-09-15 09:33:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-15 09:33:13 (GMT) |
commit | e37ac5fbb6de593521cf218aa05bc58a45c5a7c9 (patch) | |
tree | c4a326c8def6bf08986f620dae1d5b9bed3b40bc /Lib/test/test_extcall.py | |
parent | 8e9a37dde44c9fa0b961cb2db5dc8266e1f85d11 (diff) | |
download | cpython-e37ac5fbb6de593521cf218aa05bc58a45c5a7c9.zip cpython-e37ac5fbb6de593521cf218aa05bc58a45c5a7c9.tar.gz cpython-e37ac5fbb6de593521cf218aa05bc58a45c5a7c9.tar.bz2 |
gh-96751: Remove dead code from `CALL_FUNCTION_EX` opcode (GH-96752)
Diffstat (limited to 'Lib/test/test_extcall.py')
-rw-r--r-- | Lib/test/test_extcall.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py index 11d39ec..d9d85fe 100644 --- a/Lib/test/test_extcall.py +++ b/Lib/test/test_extcall.py @@ -382,6 +382,27 @@ Test a kwargs mapping with duplicated keys. ... TypeError: test.test_extcall.g() got multiple values for keyword argument 'x' +Call with dict subtype: + + >>> class MyDict(dict): + ... pass + + >>> def s1(**kwargs): + ... return kwargs + >>> def s2(*args, **kwargs): + ... return (args, kwargs) + >>> def s3(*, n, **kwargs): + ... return (n, kwargs) + + >>> md = MyDict({'a': 1, 'b': 2}) + >>> assert s1(**md) == {'a': 1, 'b': 2} + >>> assert s2(*(1, 2), **md) == ((1, 2), {'a': 1, 'b': 2}) + >>> assert s3(**MyDict({'n': 1, 'b': 2})) == (1, {'b': 2}) + >>> s3(**md) + Traceback (most recent call last): + ... + TypeError: s3() missing 1 required keyword-only argument: 'n' + Another helper function >>> def f2(*a, **b): |