Skip to content
Closed

wip #18

Show file tree
Hide file tree
Changes from all commits
Commits
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
131 changes: 83 additions & 48 deletions pandas-stubs/_libs/missing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,77 @@ from typing import (
overload,
)

from pandas import (
Index,
Series,
)
from pandas.core.arrays.boolean import BooleanArray
from pandas.core.indexes.base import Index
from pandas.core.series import Series
from typing_extensions import Self

from pandas._typing import (
S1,
A1N_co,
)

class NAType:
def __new__(cls, *args: Any, **kwargs: Any) -> Self: ...
def __format__(self, format_spec: str) -> str: ...
def __hash__(self) -> int: ...
def __reduce__(self) -> str: ...
@overload
def __add__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __add__(self, other: Series, /) -> Series: ...
@overload
def __add__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __add__(self, other: object, /) -> NAType: ...
@overload
def __radd__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __radd__(self, other: Series, /) -> Series: ...
@overload
def __radd__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __radd__(self, other: object, /) -> NAType: ...
@overload
def __sub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __sub__(self, other: Series, /) -> Series: ...
@overload
def __sub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __sub__(self, other: object, /) -> NAType: ...
@overload
def __rsub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __rsub__(self, other: Series, /) -> Series: ...
@overload
def __rsub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rsub__(self, other: object, /) -> NAType: ...
@overload
def __mul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __mul__(self, other: Series, /) -> Series: ...
@overload
def __mul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __mul__(self, other: object, /) -> NAType: ...
@overload
def __rmul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __rmul__(self, other: Series, /) -> Series: ...
@overload
def __rmul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
Expand All @@ -69,48 +84,60 @@ class NAType:
def __rmatmul__(self, other: object, /) -> NAType: ...
@overload
def __truediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __truediv__(self, other: Series, /) -> Series: ...
@overload
def __truediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __truediv__(self, other: object, /) -> NAType: ...
@overload
def __rtruediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __rtruediv__(self, other: Series, /) -> Series: ...
@overload
def __rtruediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rtruediv__(self, other: object, /) -> NAType: ...
@overload
def __floordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __floordiv__(self, other: Series, /) -> Series: ...
@overload
def __floordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __floordiv__(self, other: object, /) -> NAType: ...
@overload
def __rfloordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __rfloordiv__(self, other: Series, /) -> Series: ...
@overload
def __rfloordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __rfloordiv__(self, other: object, /) -> NAType: ...
@overload
def __mod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __mod__(self, other: Series, /) -> Series: ...
@overload
def __mod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __mod__(self, other: object, /) -> NAType: ...
@overload
def __rmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __rmod__(self, other: Series, /) -> Series: ...
@overload
def __rmod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
Expand All @@ -133,8 +160,8 @@ class NAType:
def __rdivmod__(self, other: object, /) -> tuple[NAType, NAType]: ...
@overload # type: ignore[override]
def __eq__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series[bool]: ...
self, other: Series[Any, Any], /
) -> Series[bool, BooleanArray]: ...
@overload
def __eq__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
Expand All @@ -143,8 +170,8 @@ class NAType:
) -> NAType: ...
@overload # type: ignore[override]
def __ne__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series[bool]: ...
self, other: Series[Any, Any], /
) -> Series[bool, BooleanArray]: ...
@overload
def __ne__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
Expand All @@ -153,32 +180,32 @@ class NAType:
) -> NAType: ...
@overload
def __le__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series[bool]: ...
self, other: Series[Any, Any], /
) -> Series[bool, BooleanArray]: ...
@overload
def __le__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
def __le__(self, other: object, /) -> NAType: ...
@overload
def __lt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series[bool]: ...
self, other: Series[Any, Any], /
) -> Series[bool, BooleanArray]: ...
@overload
def __lt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
def __lt__(self, other: object, /) -> NAType: ...
@overload
def __gt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series[bool]: ...
self, other: Series[Any, Any], /
) -> Series[bool, BooleanArray]: ...
@overload
def __gt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
def __gt__(self, other: object, /) -> NAType: ...
@overload
def __ge__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series[bool]: ...
self, other: Series[Any, Any], /
) -> Series[bool, BooleanArray]: ...
@overload
def __ge__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
@overload
Expand All @@ -189,16 +216,20 @@ class NAType:
def __invert__(self) -> NAType: ...
@overload
def __pow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __pow__(self, other: Series, /) -> Series: ...
@overload
def __pow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __pow__(self, other: object, /) -> NAType: ...
@overload
def __rpow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __rpow__(self, other: Series, /) -> Series: ...
@overload
def __rpow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
Expand All @@ -221,16 +252,20 @@ class NAType:
def __ror__(self, other: bool | NAType, /) -> NAType: ...
@overload
def __xor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __xor__(self, other: Series, /) -> Series: ...
@overload
def __xor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
def __xor__(self, other: object, /) -> NAType: ...
@overload
def __rxor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
self, other: Series[S1, A1N_co], /
) -> Series[S1, A1N_co]: ...
@overload
def __rxor__(self, other: Series, /) -> Series: ...
@overload
def __rxor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
@overload
Expand Down
Loading
Loading