Skip to content

Commit

Permalink
self
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins committed Nov 12, 2024
1 parent d3c595e commit ae7da21
Show file tree
Hide file tree
Showing 56 changed files with 72 additions and 85 deletions.
6 changes: 4 additions & 2 deletions pandas/_libs/arrays.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from typing import Sequence
from typing import (
Self,
Sequence,
)

import numpy as np

from pandas._typing import (
AxisInt,
DtypeObj,
Self,
Shape,
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/internals.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import (
Iterator,
Self,
Sequence,
final,
overload,
Expand All @@ -10,7 +11,6 @@ import numpy as np

from pandas._typing import (
ArrayLike,
Self,
npt,
)

Expand Down
10 changes: 5 additions & 5 deletions pandas/_libs/sparse.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Sequence
from typing import (
Self,
Sequence,
)

import numpy as np

from pandas._typing import (
Self,
npt,
)
from pandas._typing import npt

class SparseIndex:
length: int
Expand Down
3 changes: 1 addition & 2 deletions pandas/_libs/tslibs/dtypes.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from enum import Enum

from pandas._typing import Self
from typing import Self

OFFSET_TO_PERIOD_FREQSTR: dict[str, str]

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/nattype.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ from datetime import (
from typing import (
Literal,
NoReturn,
Self,
TypeAlias,
overload,
)
Expand All @@ -17,7 +18,6 @@ import numpy as np
from pandas._libs.tslibs.period import Period
from pandas._typing import (
Frequency,
Self,
TimestampNonexistent,
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/offsets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ from typing import (
Any,
Collection,
Literal,
Self,
TypeVar,
overload,
)
Expand All @@ -16,7 +17,6 @@ import numpy as np
from pandas._libs.tslibs.nattype import NaTType
from pandas._typing import (
OffsetCalendar,
Self,
npt,
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timedeltas.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ from datetime import timedelta
from typing import (
ClassVar,
Literal,
Self,
TypeAlias,
TypeVar,
overload,
Expand All @@ -15,7 +16,6 @@ from pandas._libs.tslibs import (
)
from pandas._typing import (
Frequency,
Self,
npt,
)

Expand Down
6 changes: 2 additions & 4 deletions pandas/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ from time import struct_time
from typing import (
ClassVar,
Literal,
Self,
TypeAlias,
overload,
)
Expand All @@ -22,10 +23,7 @@ from pandas._libs.tslibs import (
Tick,
Timedelta,
)
from pandas._typing import (
Self,
TimestampNonexistent,
)
from pandas._typing import TimestampNonexistent

_TimeZones: TypeAlias = str | _tzinfo | None | int

Expand Down
9 changes: 0 additions & 9 deletions pandas/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
tzinfo,
)
from os import PathLike
import sys
from typing import (
TYPE_CHECKING,
Any,
Expand Down Expand Up @@ -99,17 +98,9 @@

P = ParamSpec("P")

if sys.version_info >= (3, 11):
from typing import Self # pyright: ignore[reportUnusedImport]
from typing import Unpack # pyright: ignore[reportUnusedImport]
else:
from typing_extensions import Self # pyright: ignore[reportUnusedImport]
from typing_extensions import Unpack # pyright: ignore[reportUnusedImport]

else:
npt: Any = None
ParamSpec: Any = None
Self: Any = None
TypeGuard: Any = None
Concatenate: Any = None
Unpack: Any = None
Expand Down
6 changes: 2 additions & 4 deletions pandas/core/arrays/_arrow_string_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
TYPE_CHECKING,
Any,
Literal,
Self,
)

import numpy as np
Expand All @@ -25,10 +26,7 @@
if TYPE_CHECKING:
from collections.abc import Callable

from pandas._typing import (
Scalar,
Self,
)
from pandas._typing import Scalar


class ArrowStringArrayMixin:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
TYPE_CHECKING,
Any,
Literal,
Self,
cast,
overload,
)
Expand All @@ -23,7 +24,6 @@
PositionalIndexer2D,
PositionalIndexerTuple,
ScalarIndexer,
Self,
SequenceIndexer,
Shape,
TakeIndexer,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
TYPE_CHECKING,
Any,
Literal,
Self,
cast,
overload,
)
Expand Down Expand Up @@ -193,7 +194,6 @@ def floordiv_compat(
NumpyValueArrayLike,
PositionalIndexer,
Scalar,
Self,
SortKind,
TakeIndexer,
TimeAmbiguous,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Any,
ClassVar,
Literal,
Self,
cast,
overload,
)
Expand Down Expand Up @@ -95,7 +96,6 @@
NumpyValueArrayLike,
PositionalIndexer,
ScalarIndexer,
Self,
SequenceIndexer,
Shape,
SortKind,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import (
TYPE_CHECKING,
ClassVar,
Self,
cast,
)

Expand All @@ -30,7 +31,6 @@

from pandas._typing import (
DtypeObj,
Self,
npt,
type_t,
)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import (
TYPE_CHECKING,
Literal,
Self,
cast,
overload,
)
Expand Down Expand Up @@ -105,7 +106,6 @@
DtypeObj,
NpDtype,
Ordered,
Self,
Shape,
SortKind,
npt,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
TYPE_CHECKING,
Any,
Literal,
Self,
Union,
cast,
final,
Expand Down Expand Up @@ -64,7 +65,6 @@
PositionalIndexer2D,
PositionalIndexerTuple,
ScalarIndexer,
Self,
SequenceIndexer,
TakeIndexer,
TimeAmbiguous,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
)
from typing import (
TYPE_CHECKING,
Self,
TypeVar,
cast,
overload,
Expand Down Expand Up @@ -84,7 +85,6 @@
DateTimeErrorChoices,
DtypeObj,
IntervalClosedType,
Self,
TimeAmbiguous,
TimeNonexistent,
npt,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import (
TYPE_CHECKING,
Literal,
Self,
Union,
overload,
)
Expand All @@ -31,7 +32,6 @@
NpDtype,
PositionalIndexer,
ScalarIndexer,
Self,
SequenceIndexer,
SortKind,
TimeArrayLike,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/masked.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
TYPE_CHECKING,
Any,
Literal,
Self,
cast,
overload,
)
Expand Down Expand Up @@ -92,7 +93,6 @@
PositionalIndexer,
Scalar,
ScalarIndexer,
Self,
SequenceIndexer,
Shape,
npt,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import (
TYPE_CHECKING,
Any,
Self,
)

import numpy as np
Expand Down Expand Up @@ -36,7 +37,6 @@

from pandas._typing import (
DtypeObj,
Self,
npt,
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/numpy_.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import (
TYPE_CHECKING,
Literal,
Self,
)

import numpy as np
Expand Down Expand Up @@ -36,7 +37,6 @@
InterpolateOptions,
NpDtype,
Scalar,
Self,
npt,
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
TYPE_CHECKING,
Any,
Literal,
Self,
TypeVar,
cast,
overload,
Expand Down Expand Up @@ -86,7 +87,6 @@
NpDtype,
NumpySorter,
NumpyValueArrayLike,
Self,
npt,
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
TYPE_CHECKING,
Any,
Literal,
Self,
cast,
overload,
)
Expand Down Expand Up @@ -113,7 +114,6 @@ class ellipsis(Enum):
PositionalIndexer,
Scalar,
ScalarIndexer,
Self,
SequenceIndexer,
npt,
)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/string_.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
TYPE_CHECKING,
Any,
Literal,
Self,
cast,
)
import warnings
Expand Down Expand Up @@ -81,7 +82,6 @@
NumpySorter,
NumpyValueArrayLike,
Scalar,
Self,
npt,
type_t,
)
Expand Down
Loading

0 comments on commit ae7da21

Please sign in to comment.