Skip to content

Commit 5c2a592

Browse files
committed
fix(comment): reduce Never #1312 (review)
1 parent 0a86897 commit 5c2a592

File tree

4 files changed

+144
-149
lines changed

4 files changed

+144
-149
lines changed

pandas-stubs/_typing.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ from re import Pattern
1515
import sys
1616
from typing import (
1717
Any,
18+
Generic,
1819
Literal,
1920
Protocol,
2021
SupportsIndex,
2122
TypedDict,
2223
Union,
2324
overload,
25+
override,
2426
)
2527

2628
import numpy as np
@@ -1038,4 +1040,14 @@ DictConvertible: TypeAlias = FulldatetimeDict | DataFrame
10381040
# where it is the only acceptable type.
10391041
Incomplete: TypeAlias = Any
10401042

1043+
# differentiating between bool and int/float/complex
1044+
# https://github.com/pandas-dev/pandas-stubs/pull/1312#pullrequestreview-3126128971
1045+
class Just(Protocol, Generic[T]):
1046+
@property # type: ignore[override]
1047+
@override
1048+
def __class__(self, /) -> type[T]: ...
1049+
@__class__.setter
1050+
@override
1051+
def __class__(self, t: type[T], /) -> None: ...
1052+
10411053
__all__ = ["npt", "type_t"]

0 commit comments

Comments
 (0)