Skip to content
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

Manually defining a class via attributes does not allow for passing kwargs #5406

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stuhood
Copy link

@stuhood stuhood commented Oct 10, 2024

The recommended method of creating a subclass from #1193 (comment) does not seem to allow for passing keyword arguments.

This test fails with:

    def test_kw_only():
>       assert (m.KwOnlyMethod().test("x", y="y") == 0)
E       TypeError: (): incompatible function arguments. The following argument types are supported:
E           1. (x: object, *, y: object, arg1: object) -> int
E
E       Invoked with: <importlib._bootstrap.MwOnlyMethod object at 0x11029e900>, 'x'; kwargs: y='y'


../../../../tests/test_class.py:507: TypeError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant