8000 MAINT: Do not let ``_GenericAlias`` wrap the underlying classes' ``__class__`` attribute by BvB93 · Pull Request #21982 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: Do not let _GenericAlias wrap the underlying classes' __class__ attribute #21982

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 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
MAINT: Do not let _GenericAlias wrap the underlying classes `__clas…
…s__` attribute

Adapt to the 3.11b4 changes introduced in python/cpython#93754
  • Loading branch information
BvB93 committed Jul 14, 2022
commit d95c4285c4b8dbb8cf57b1ad5a887c8e924dc924
1 change: 1 addition & 0 deletions numpy/_typing/_generic_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def __iter__(self: _T) -> Generator[_T, None, None]:
"__deepcopy__",
"__unpacked__",
"__typing_unpacked_tuple_args__",
"__class__",
})

def __getattribute__(self, name: str) -> Any:
Expand Down
5 changes: 4 additions & 1 deletion numpy/typing/tests/test_generic_alias.py
8255
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ def test_dir(self) -> None:
# and they are thus now longer equivalent
("__ne__", lambda n: n != next(iter(n)), ("beta", 1)),

# >= beta3 stuff
# >= beta3
("__typing_unpacked_tuple_args__",
lambda n: n.__typing_unpacked_tuple_args__, ("beta", 3)),

# >= beta4
("__class__", lambda n: n.__class__ == type(n), ("beta", 4)),
])
def test_py311_features(
self,
Expand Down
0