Skip to content

Commit

Permalink
MAINT: Do not let _GenericAlias wrap the underlying classes `__clas…
Browse files Browse the repository at this point in the history
…s__` attribute

Adapt to the 3.11b4 changes introduced in python/cpython#93754
  • Loading branch information
BvB93 committed Jul 14, 2022
1 parent 3784656 commit d95c428
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions numpy/_typing/_generic_alias.py
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
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 comments on commit d95c428

Please sign in to comment.