Skip to content

Commit bb462da

Browse files
committed
TYP: TypeVar defaults for numpy.iinfo and numpy.finfo
1 parent 32abfe2 commit bb462da

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

numpy/__init__.pyi

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ from typing import (
205205
SupportsComplex,
206206
SupportsFloat,
207207
SupportsInt,
208-
TypeVar,
209208
Protocol,
210209
SupportsIndex,
211210
Final,
@@ -219,7 +218,7 @@ from typing import (
219218
# This is because the `typeshed` stubs for the standard library include
220219
# `typing_extensions` stubs:
221220
# https://github.com/python/typeshed/blob/main/stdlib/typing_extensions.pyi
222-
from typing_extensions import LiteralString, Self
221+
from typing_extensions import LiteralString, Self, TypeVar
223222

224223
from numpy import (
225224
core,
@@ -4131,7 +4130,7 @@ class busdaycalendar:
41314130
def holidays(self) -> NDArray[datetime64]: ...
41324131

41334132

4134-
_FloatType_co = TypeVar('_FloatType_co', bound=floating[Any], covariant=True)
4133+
_FloatType_co = TypeVar('_FloatType_co', bound=floating[Any], covariant=True, default=floating[NBitBase])
41354134

41364135
class finfo(Generic[_FloatType_co]):
41374136
dtype: Final[dtype[_FloatType_co]]
@@ -4167,7 +4166,7 @@ class finfo(Generic[_FloatType_co]):
41674166
cls, dtype: str
41684167
) -> finfo[floating[Any]]: ...
41694168

4170-
_IntType_co = TypeVar("_IntType_co", bound=integer[Any], covariant=True)
4169+
_IntType_co = TypeVar("_IntType_co", bound=integer[Any], covariant=True, default=integer[NBitBase])
41714170

41724171
class iinfo(Generic[_IntType_co]):
41734172
dtype: Final[dtype[_IntType_co]]

0 commit comments

Comments
 (0)