Skip to content

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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
style: pre-commit fixes
  • Loading branch information
pre-commit-ci[bot] committed Oct 10, 2024
commit 3cd11315da96219d9ce99f35894554999354d05d
3 changes: 1 addition & 2 deletions tests/test_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,7 @@ TEST_SUBMODULE(class_, m) {
py::arg("x"),
py::kw_only(),
py::arg("y"),
py::is_method(py::none())
);
py::is_method(py::none()));

m.attr("KwOnlyMethod") = parent_metaclass("MwOnlyMethod", py::make_tuple(), attributes);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,4 @@


def test_kw_only():
assert (m.KwOnlyMethod().test("x", y="y") == 0)
assert m.KwOnlyMethod().test("x", y="y") == 0

Check failure on line 507 in tests/test_class.py

View workflow job for this annotation

GitHub Actions / 🐍 3.13 • ubuntu-20.04 • x64

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

Check failure on line 507 in tests/test_class.py

View workflow job for this annotation

GitHub Actions / 🐍 3.8 • ubuntu-20.04 • x64 -DPYBIND11_FINDPYTHON=ON -DCMAKE_CXX_FLAGS="-D_=1"

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

Check failure on line 507 in tests/test_class.py

View workflow job for this annotation

GitHub Actions / 🐍 3.11 • ubuntu-latest • x64

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

Check failure on line 507 in tests/test_class.py

View workflow job for this annotation

GitHub Actions / 🐍 3.9 • ubuntu-20.04 • x64

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

Check failure on line 507 in tests/test_class.py

View workflow job for this annotation

GitHub Actions / 🐍 3.12 • ubuntu-20.04 • x64

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

Check failure on line 507 in tests/test_class.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.10 • ubuntu-20.04 • x64

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

Check failure on line 507 in tests/test_class.py

View workflow job for this annotation

GitHub Actions / 🐍 graalpy-24.1 • ubuntu-20.04 • x64

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

Check failure on line 507 in tests/test_class.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.8 • ubuntu-20.04 • x64 -DPYBIND11_FINDPYTHON=ON

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

Check failure on line 507 in tests/test_class.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.9 • ubuntu-20.04 • x64

test_kw_only TypeError: (): incompatible function arguments. The following argument types are supported: 1. (x: object, *, y: object, arg1: object) -> int Invoked with: <importlib._bootstrap.MwOnlyMethod object at 0x0000000004750058>, 'x'; kwargs: y='y'
Loading