Skip to content

Commit c1eda8e

Browse files
committed
ENH: Mark flagsobj as non-hashable and non-subclassable
1 parent 43d0638 commit c1eda8e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

numpy/core/multiarray.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ from numpy.typing import (
7979
)
8080

8181
if sys.version_info >= (3, 8):
82-
from typing import SupportsIndex, Final, Literal as L
82+
from typing import SupportsIndex, final, Final, Literal as L
8383
else:
84-
from typing_extensions import SupportsIndex, Final, Literal as L
84+
from typing_extensions import SupportsIndex, final, Final, Literal as L
8585

8686
_SCT = TypeVar("_SCT", bound=generic)
8787
_ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
@@ -949,7 +949,9 @@ def compare_chararrays(
949949

950950
def add_docstring(__obj: Callable[..., Any], __docstring: str) -> None: ...
951951

952+
@final
952953
class flagsobj:
954+
__hash__: None # type: ignore[assignment]
953955
aligned: bool
954956
# NOTE: deprecated
955957
# updateifcopy: bool

0 commit comments

Comments
 (0)