8000 gh-87106: Fix `inspect.signature.bind` handling of positional-only arguments with `**kwargs` by jacobtylerwalls · Pull Request #103404 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-87106: Fix inspect.signature.bind handling of positional-only arguments with **kwargs #103404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
May 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify test case
  • Loading branch information
jacobtylerwalls committed May 5, 2024
commit 366bb96d7617d8fa9bd8566d206b7af022ad98cf
6 changes: 3 additions & 3 deletions Lib/test/test_inspect/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5081,11 +5081,11 @@ def test(a_po, b_po, c_po=3, /, foo=42, *, bar=50, **kwargs):
with self.assertRaisesRegex(TypeError, "missing 2 required positional arguments"):
self.call(test, a_po=1, b_po=2)

def without_var_kwargs(a_po, b_po, c_po=3, /, foo=42, *, bar=50):
return a_po, b_po, c_po, foo, bar
def without_var_kwargs(c_po=3, /):
return c_po

with self.assertRaisesRegex(TypeError, "positional-only arguments passed as keyword"):
self.call(without_var_kwargs, 1, 2, foo=4, bar=5, c_po=10)
self.call(without_var_kwargs, c_po=10)

def test_signature_bind_with_self_arg(self):
# Issue #17071: one of the parameters is named "self
Expand Down
0