Skip to content

Commit

Permalink
Typing: Added missing methods to NaTType stub (#59995)
Browse files Browse the repository at this point in the history
added missing methods to NaTType stub
  • Loading branch information
randolf-scholz authored Oct 7, 2024
1 parent b3d0b96 commit 02267e5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pandas/_libs/tslibs/nattype.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ from typing import (
Literal,
NoReturn,
TypeAlias,
overload,
)

import numpy as np
Expand Down Expand Up @@ -159,15 +160,31 @@ class NaTType:
# inject Period properties
@property
def qyear(self) -> float: ...
# comparisons
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
__lt__: _NatComparison
__le__: _NatComparison
__gt__: _NatComparison
__ge__: _NatComparison
# unary operators
def __pos__(self) -> Self: ...
def __neg__(self) -> Self: ...
# binary operators
def __sub__(self, other: Self | timedelta | datetime) -> Self: ...
def __rsub__(self, other: Self | timedelta | datetime) -> Self: ...
def __add__(self, other: Self | timedelta | datetime) -> Self: ...
def __radd__(self, other: Self | timedelta | datetime) -> Self: ...
def __mul__(self, other: float) -> Self: ... # analogous to timedelta
def __rmul__(self, other: float) -> Self: ...
@overload # analogous to timedelta
def __truediv__(self, other: Self | timedelta) -> float: ... # Literal[NaN]
@overload
def __truediv__(self, other: float) -> Self: ...
@overload # analogous to timedelta
def __floordiv__(self, other: Self | timedelta) -> float: ... # Literal[NaN]
@overload
def __floordiv__(self, other: float) -> Self: ...
# other
def __hash__(self) -> int: ...
def as_unit(self, unit: str, round_ok: bool = ...) -> NaTType: ...

0 comments on commit 02267e5

Please sign in to comment.