Skip to content

Commit 99d319e

Browse files
authored
Merge pull request numpy#27153 from jorenham/typing/ufunc-incompatible-overrides
TYP: Fix incompatible overrides in the ``numpy._typing._ufunc`` stubs
2 parents 0834d68 + 6fe9a25 commit 99d319e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

numpy/_typing/_ufunc.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ from typing import (
1717
Protocol,
1818
NoReturn,
1919
)
20+
from typing_extensions import LiteralString
2021

2122
from numpy import ufunc, _CastingKind, _OrderKACF
2223
from numpy.typing import NDArray
@@ -32,9 +33,9 @@ _3Tuple = tuple[_T, _T, _T]
3233
_4Tuple = tuple[_T, _T, _T, _T]
3334

3435
_NTypes = TypeVar("_NTypes", bound=int, covariant=True)
35-
_IDType = TypeVar("_IDType", bound=Any, covariant=True)
36-
_NameType = TypeVar("_NameType", bound=str, covariant=True)
37-
_Signature = TypeVar("_Signature", bound=str, covariant=True)
36+
_IDType = TypeVar("_IDType", covariant=True)
37+
_NameType = TypeVar("_NameType", bound=LiteralString, covariant=True)
38+
_Signature = TypeVar("_Signature", bound=LiteralString, covariant=True)
3839

3940

4041
class _SupportsArrayUFunc(Protocol):

0 commit comments

Comments
 (0)