File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11__all__ = ("HasArrayNamespace" ,)
22
33from types import ModuleType
4- from typing import Protocol , final
4+ from typing import Protocol
55from typing_extensions import TypeVar
66
77T = TypeVar ("T" , bound = object , default = ModuleType ) # PEP 696 default
88
99
10- @final
1110class HasArrayNamespace (Protocol [T ]): # type: ignore[misc] # see python/mypy#17288
1211 """Protocol for classes that have an `__array_namespace__` method.
1312
Original file line number Diff line number Diff line change 55
66
77@runtime_checkable
8- class CheckableHasArrayNamespace (xpt .HasArrayNamespace , Protocol ): # type: ignore[misc]
9- """Runtime checkable version of HasArrayNamespace."""
8+ class CheckableHasArrayNamespace (xpt .HasArrayNamespace , Protocol ):
9+ """A runtime-checkable version of the HasArrayNamespace protocol."""
10+
11+ # This class is used to ensure that the protocol can be checked at runtime.
12+ # It inherits from xpt.HasArrayNamespace and is marked as runtime_checkable.
1013
1114
1215class GoodArray :
You can’t perform that action at this time.
0 commit comments