Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d157fa1
wip
MarcoGorelli Aug 26, 2025
b305640
maybe fix the overloads
MarcoGorelli Aug 26, 2025
1e15cb9
wip tests
MarcoGorelli Aug 26, 2025
517c7d4
fixup test
MarcoGorelli Aug 26, 2025
c54fe63
appease mypy
MarcoGorelli Aug 26, 2025
527f00f
wip
MarcoGorelli Aug 26, 2025
e5c8df7
fixup
MarcoGorelli Aug 26, 2025
2ae0638
fixup
MarcoGorelli Aug 26, 2025
bc73767
remove ndarray overloads as they dont really make sense for a nullabl…
MarcoGorelli Aug 26, 2025
2527f5d
fixup
MarcoGorelli Aug 26, 2025
6760c3d
fixup
MarcoGorelli Aug 26, 2025
eef5694
Merge remote-tracking branch 'upstream/main' into natype-arithemtic
MarcoGorelli Aug 26, 2025
a686ae9
fixup
MarcoGorelli Aug 26, 2025
08e604c
mypy fixup
MarcoGorelli Aug 26, 2025
a094e3e
remove `__bool__`, and comparisons (eq/ne/gt/lt/...) with `Series`/`I…
MarcoGorelli Aug 27, 2025
cb1da48
remove redundant annotation
MarcoGorelli Aug 27, 2025
340582c
comment cases which require other fixes
MarcoGorelli Aug 27, 2025
8c1eced
note pyright bug
MarcoGorelli Aug 27, 2025
83683e5
Merge remote-tracking branch 'upstream/main' into natype-arithemtic
MarcoGorelli Sep 5, 2025
ce16ae2
update pyright
MarcoGorelli Sep 5, 2025
c61f750
keep divmod(na, 1), ignore pyright, link to issue
MarcoGorelli Sep 12, 2025
7213016
uncomment some parts
MarcoGorelli Sep 12, 2025
34da99d
Merge remote-tracking branch 'upstream/main' into natype-arithemtic
MarcoGorelli Sep 12, 2025
c49dcec
remove more outdated commented-out tests
MarcoGorelli Sep 12, 2025
e2537a5
linting
MarcoGorelli Sep 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove ndarray overloads as they dont really make sense for a nullabl…
…e-only object
  • Loading branch information
MarcoGorelli committed Aug 26, 2025
commit bc73767c6a9c0dc331861aed347e6db5619d3d56
57 changes: 0 additions & 57 deletions pandas-stubs/_libs/missing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ from typing import (
overload,
)

import numpy.typing as npt
from pandas import (
Index,
Series,
Expand All @@ -26,8 +25,6 @@ class NAType:
@overload
def __add__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __add__(self, other: npt.NDArray[Any], /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __add__(self, other: object, /) -> NAType: ...
@overload
def __radd__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -44,8 +41,6 @@ class NAType:
@overload
def __sub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __sub__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __sub__(self, other: object, /) -> NAType: ...
@overload
def __rsub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -54,8 +49,6 @@ class NAType:
@overload
def __rsub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rsub__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __rsub__(self, other: object, /) -> NAType: ...
@overload
def __mul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -64,8 +57,6 @@ class NAType:
@overload
def __mul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __mul__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __mul__(self, other: object, /) -> NAType: ...
@overload
def __rmul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -74,12 +65,8 @@ class NAType:
@overload
def __rmul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rmul__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __rmul__(self, other: object, /) -> NAType: ...
@overload
def __matmul__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __matmul__(self, other: object, /) -> NAType: ...
def __rmatmul__(self, other: object, /) -> NAType: ...
@overload
Expand All @@ -89,8 +76,6 @@ class NAType:
@overload
def __truediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __truediv__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __truediv__(self, other: object, /) -> NAType: ...
@overload
def __rtruediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -99,8 +84,6 @@ class NAType:
@overload
def __rtruediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rtruediv__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __rtruediv__(self, other: object, /) -> NAType: ...
@overload
def __floordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -109,8 +92,6 @@ class NAType:
@overload
def __floordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __floordiv__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __floordiv__(self, other: object, /) -> NAType: ...
@overload
def __rfloordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -119,8 +100,6 @@ class NAType:
@overload
def __rfloordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rfloordiv__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __rfloordiv__(self, other: object, /) -> NAType: ...
@overload
def __mod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -129,8 +108,6 @@ class NAType:
@overload
def __mod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __mod__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __mod__(self, other: object, /) -> NAType: ...
@overload
def __rmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -139,8 +116,6 @@ class NAType:
@overload
def __rmod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rmod__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __rmod__(self, other: object, /) -> NAType: ...
@overload
def __divmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -149,8 +124,6 @@ class NAType:
@overload
def __divmod__(self, other: Index, /) -> tuple[Index, Index]: ... # type: ignore[overload-overlap]
@overload
def __divmod__(self, other: npt.NDArray, /) -> tuple[npt.NDArray, npt.NDArray]: ... # type: ignore[overload-overlap]
@overload
def __divmod__(self, other: object, /) -> tuple[NAType, NAType]: ...
@overload
def __rdivmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -159,8 +132,6 @@ class NAType:
@overload
def __rdivmod__(self, other: Index, /) -> tuple[Index, Index]: ... # type: ignore[overload-overlap]
@overload
def __rdivmod__(self, other: npt.NDArray, /) -> tuple[npt.NDArray, npt.NDArray]: ... # type: ignore[overload-overlap]
@overload
def __rdivmod__(self, other: object, /) -> tuple[NAType, NAType]: ...
@overload # type: ignore[override]
def __eq__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -169,8 +140,6 @@ class NAType:
@overload
def __eq__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __eq__( # pyright: ignore[reportIncompatibleMethodOverride]
self, other: object, /
) -> NAType: ...
Expand All @@ -181,8 +150,6 @@ class NAType:
@overload
def __ne__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __ne__( # pyright: ignore[reportIncompatibleMethodOverride]
self, other: object, /
) -> NAType: ...
Expand All @@ -193,8 +160,6 @@ class NAType:
@overload
def __le__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
def __le__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __le__(self, other: object, /) -> NAType: ...
@overload
def __lt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -203,8 +168,6 @@ class NAType:
@overload
def __lt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
def __lt__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __lt__(self, other: object, /) -> NAType: ...
@overload
def __gt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -213,8 +176,6 @@ class NAType:
@overload
def __gt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
def __gt__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __gt__(self, other: object, /) -> NAType: ...
@overload
def __ge__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -223,8 +184,6 @@ class NAType:
@overload
def __ge__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
def __ge__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __ge__(self, other: object, /) -> NAType: ...
def __neg__(self) -> NAType: ...
def __pos__(self) -> NAType: ...
Expand All @@ -237,8 +196,6 @@ class NAType:
@overload
def __pow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __pow__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __pow__(self, other: object, /) -> NAType: ...
@overload
def __rpow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -247,8 +204,6 @@ class NAType:
@overload
def __rpow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rpow__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __rpow__(self, other: object, /) -> NAType: ...
@overload
def __and__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -257,8 +212,6 @@ class NAType:
@overload
def __and__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __and__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __and__(self, other: Literal[False], /) -> Literal[False]: ...
@overload
def __and__(self, other: object, /) -> NAType: ...
Expand All @@ -269,8 +222,6 @@ class NAType:
@overload
def __rand__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rand__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __rand__(self, other: Literal[False], /) -> Literal[False]: ...
@overload
def __rand__(self, other: object, /) -> NAType: ...
Expand All @@ -281,8 +232,6 @@ class NAType:
@overload
def __or__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __or__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __or__(self, other: Literal[True], /) -> Literal[True]: ...
@overload
def __or__(self, other: object, /) -> NAType: ...
Expand All @@ -293,8 +242,6 @@ class NAType:
@overload
def __ror__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __ror__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __ror__(self, other: Literal[True], /) -> Literal[True]: ...
@overload
def __ror__(self, other: object, /) -> NAType: ...
Expand All @@ -305,8 +252,6 @@ class NAType:
@overload
def __xor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __xor__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __xor__(self, other: object, /) -> NAType: ...
@overload
def __rxor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
Expand All @@ -315,8 +260,6 @@ class NAType:
@overload
def __rxor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rxor__(self, other: npt.NDArray, /) -> npt.NDArray: ... # type: ignore[overload-overlap]
@overload
def __rxor__(self, other: object, /) -> NAType: ...
__array_priority__: int
def __array_ufunc__(
Expand Down
Loading