Skip to content

Commit 51499fb

Browse files
committed
Merge branch 'main' into sas/byteswap
2 parents 17c965f + e915b0a commit 51499fb

File tree

178 files changed

+4067
-1135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+4067
-1135
lines changed

.github/workflows/macos-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
defaults:
2424
run:
2525
shell: bash -el {0}
26-
timeout-minutes: 90
26+
timeout-minutes: 120
2727
strategy:
2828
matrix:
2929
os: [macos-latest, windows-latest]

.pre-commit-config.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
pass_filenames: true
1919
require_serial: false
2020
- repo: https://github.com/python/black
21-
rev: 22.3.0
21+
rev: 22.6.0
2222
hooks:
2323
- id: black
2424
- repo: https://github.com/codespell-project/codespell
@@ -27,7 +27,7 @@ repos:
2727
- id: codespell
2828
types_or: [python, rst, markdown]
2929
- repo: https://github.com/pre-commit/pre-commit-hooks
30-
rev: v4.2.0
30+
rev: v4.3.0
3131
hooks:
3232
- id: debug-statements
3333
- id: end-of-file-fixer
@@ -59,7 +59,7 @@ repos:
5959
hooks:
6060
- id: isort
6161
- repo: https://github.com/asottile/pyupgrade
62-
rev: v2.32.1
62+
rev: v2.34.0
6363
hooks:
6464
- id: pyupgrade
6565
args: [--py38-plus]
@@ -74,7 +74,7 @@ repos:
7474
types: [text] # overwrite types: [rst]
7575
types_or: [python, rst]
7676
- repo: https://github.com/sphinx-contrib/sphinx-lint
77-
rev: v0.6
77+
rev: v0.6.1
7878
hooks:
7979
- id: sphinx-lint
8080
- repo: https://github.com/asottile/yesqa
@@ -229,3 +229,11 @@ repos:
229229
entry: python scripts/validate_min_versions_in_sync.py
230230
language: python
231231
files: ^(ci/deps/actions-.*-minimum_versions\.yaml|pandas/compat/_optional\.py)$
232+
- id: flake8-pyi
233+
name: flake8-pyi
234+
entry: flake8 --extend-ignore=E301,E302,E305,E701,E704
235+
types: [pyi]
236+
language: python
237+
additional_dependencies:
238+
- flake8==4.0.1
239+
- flake8-pyi==22.5.1

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Release Notes
22
=============
33

4-
The list of changes to Pandas between each release can be found
4+
The list of changes to pandas between each release can be found
55
[here](https://pandas.pydata.org/pandas-docs/stable/whatsnew/index.html). For full
66
details, see the commit logs at https://github.com/pandas-dev/pandas.

doc/redirects.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ generated/pandas.IntervalIndex.mid,../reference/api/pandas.IntervalIndex.mid
761761
generated/pandas.IntervalIndex.overlaps,../reference/api/pandas.IntervalIndex.overlaps
762762
generated/pandas.IntervalIndex.right,../reference/api/pandas.IntervalIndex.right
763763
generated/pandas.IntervalIndex.set_closed,../reference/api/pandas.IntervalIndex.set_closed
764+
generated/pandas.IntervalIndex.set_inclusive,../reference/api/pandas.IntervalIndex.set_inclusive
764765
generated/pandas.IntervalIndex.to_tuples,../reference/api/pandas.IntervalIndex.to_tuples
765766
generated/pandas.IntervalIndex.values,../reference/api/pandas.IntervalIndex.values
766767
generated/pandas.Interval.left,../reference/api/pandas.Interval.left

doc/source/reference/arrays.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ Properties
304304
:toctree: api/
305305

306306
Interval.inclusive
307+
Interval.closed
307308
Interval.closed_left
308309
Interval.closed_right
309310
Interval.is_empty
@@ -351,6 +352,7 @@ A collection of intervals may be stored in an :class:`arrays.IntervalArray`.
351352
arrays.IntervalArray.contains
352353
arrays.IntervalArray.overlaps
353354
arrays.IntervalArray.set_closed
355+
arrays.IntervalArray.set_inclusive
354356
arrays.IntervalArray.to_tuples
355357

356358

doc/source/reference/indexing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ IntervalIndex components
251251
IntervalIndex.get_loc
252252
IntervalIndex.get_indexer
253253
IntervalIndex.set_closed
254+
IntervalIndex.set_inclusive
254255
IntervalIndex.contains
255256
IntervalIndex.overlaps
256257
IntervalIndex.to_tuples

doc/source/reference/testing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Exceptions and warnings
2626

2727
errors.AbstractMethodError
2828
errors.AccessorRegistrationWarning
29+
errors.CSSWarning
2930
errors.DataError
3031
errors.DtypeWarning
3132
errors.DuplicateLabelError

doc/source/user_guide/groupby.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,10 @@ Alternatively, the built-in methods could be used to produce the same outputs.
839839

840840
.. ipython:: python
841841
842-
max = ts.groupby(lambda x: x.year).transform("max")
843-
min = ts.groupby(lambda x: x.year).transform("min")
842+
max_ts = ts.groupby(lambda x: x.year).transform("max")
843+
min_ts = ts.groupby(lambda x: x.year).transform("min")
844844
845-
max - min
845+
max_ts - min_ts
846846
847847
Another common data transform is to replace missing data with the group mean.
848848

doc/source/whatsnew/v1.4.4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Fixed regressions
2424
Bug fixes
2525
~~~~~~~~~
2626
- The :class:`errors.FutureWarning` raised when passing arguments (other than ``filepath_or_buffer``) as positional in :func:`read_csv` is now raised at the correct stacklevel (:issue:`47385`)
27-
-
27+
- Bug in :meth:`DataFrame.to_sql` when ``method`` was a ``callable`` that did not return an ``int`` and would raise a ``TypeError`` (:issue:`46891`)
2828

2929
.. ---------------------------------------------------------------------------
3030

doc/source/whatsnew/v1.5.0.rst

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ Other enhancements
275275
- :class:`.DataError`, :class:`.SpecificationError`, :class:`.SettingWithCopyError`, :class:`.SettingWithCopyWarning`, :class:`.NumExprClobberingError`, :class:`.UndefinedVariableError`, and :class:`.IndexingError` are now exposed in ``pandas.errors`` (:issue:`27656`)
276276
- Added ``check_like`` argument to :func:`testing.assert_series_equal` (:issue:`47247`)
277277
- Allow reading compressed SAS files with :func:`read_sas` (e.g., ``.sas7bdat.gz`` files)
278+
- :meth:`DatetimeIndex.astype` now supports casting timezone-naive indexes to ``datetime64[s]``, ``datetime64[ms]``, and ``datetime64[us]``, and timezone-aware indexes to the corresponding ``datetime64[unit, tzname]`` dtypes (:issue:`47579`)
279+
- :class:`Series` reducers (e.g. ``min``, ``max``, ``sum``, ``mean``) will now successfully operate when the dtype is numeric and ``numeric_only=True`` is provided; previously this would raise a ``NotImplementedError`` (:issue:`47500`)
280+
- :meth:`RangeIndex.union` now can return a :class:`RangeIndex` instead of a :class:`Int64Index` if the resulting values are equally spaced (:issue:`47557`, :issue:`43885`)
278281

279282
.. ---------------------------------------------------------------------------
280283
.. _whatsnew_150.notable_bug_fixes:
@@ -759,14 +762,15 @@ Other Deprecations
759762
- Deprecated the ``closed`` argument in :class:`IntervalIndex` in favor of ``inclusive`` argument; In a future version passing ``closed`` will raise (:issue:`40245`)
760763
- Deprecated the ``closed`` argument in :class:`IntervalDtype` in favor of ``inclusive`` argument; In a future version passing ``closed`` will raise (:issue:`40245`)
761764
- Deprecated the ``closed`` argument in :class:`.IntervalArray` in favor of ``inclusive`` argument; In a future version passing ``closed`` will raise (:issue:`40245`)
762-
- Deprecated the ``closed`` argument in :class:`IntervalTree` in favor of ``inclusive`` argument; In a future version passing ``closed`` will raise (:issue:`40245`)
765+
- Deprecated :meth:`.IntervalArray.set_closed` and :meth:`.IntervalIndex.set_closed` in favor of ``set_inclusive``; In a future version ``set_closed`` will get removed (:issue:`40245`)
763766
- Deprecated the ``closed`` argument in :class:`ArrowInterval` in favor of ``inclusive`` argument; In a future version passing ``closed`` will raise (:issue:`40245`)
764767
- Deprecated allowing ``unit="M"`` or ``unit="Y"`` in :class:`Timestamp` constructor with a non-round float value (:issue:`47267`)
765768
- Deprecated the ``display.column_space`` global configuration option (:issue:`7576`)
766769
- Deprecated the argument ``na_sentinel`` in :func:`factorize`, :meth:`Index.factorize`, and :meth:`.ExtensionArray.factorize`; pass ``use_na_sentinel=True`` instead to use the sentinel ``-1`` for NaN values and ``use_na_sentinel=False`` instead of ``na_sentinel=None`` to encode NaN values (:issue:`46910`)
767770
- Deprecated :meth:`DataFrameGroupBy.transform` not aligning the result when the UDF returned DataFrame (:issue:`45648`)
768771
- Clarified warning from :func:`to_datetime` when delimited dates can't be parsed in accordance to specified ``dayfirst`` argument (:issue:`46210`)
769-
772+
- Deprecated :class:`Series` and :class:`Resampler` reducers (e.g. ``min``, ``max``, ``sum``, ``mean``) raising a ``NotImplementedError`` when the dtype is non-numric and ``numeric_only=True`` is provided; this will raise a ``TypeError`` in a future version (:issue:`47500`)
773+
- Deprecated :meth:`Series.rank` returning an empty result when the dtype is non-numeric and ``numeric_only=True`` is provided; this will raise a ``TypeError`` in a future version (:issue:`47500`)
770774

771775
.. ---------------------------------------------------------------------------
772776
.. _whatsnew_150.performance:
@@ -852,6 +856,7 @@ Conversion
852856
- Bug in metaclass of generic abstract dtypes causing :meth:`DataFrame.apply` and :meth:`Series.apply` to raise for the built-in function ``type`` (:issue:`46684`)
853857
- Bug in :meth:`DataFrame.to_records` returning inconsistent numpy types if the index was a :class:`MultiIndex` (:issue:`47263`)
854858
- Bug in :meth:`DataFrame.to_dict` for ``orient="list"`` or ``orient="index"`` was not returning native types (:issue:`46751`)
859+
- Bug in :meth:`DataFrame.apply` that returns a :class:`DataFrame` instead of a :class:`Series` when applied to an empty :class:`DataFrame` and ``axis=1`` (:issue:`39111`)
855860

856861
Strings
857862
^^^^^^^
@@ -880,8 +885,10 @@ Indexing
880885
- Bug when setting a value too large for a :class:`Series` dtype failing to coerce to a common type (:issue:`26049`, :issue:`32878`)
881886
- Bug in :meth:`loc.__setitem__` treating ``range`` keys as positional instead of label-based (:issue:`45479`)
882887
- Bug in :meth:`Series.__setitem__` when setting ``boolean`` dtype values containing ``NA`` incorrectly raising instead of casting to ``boolean`` dtype (:issue:`45462`)
888+
- Bug in :meth:`Series.loc` raising with boolean indexer containing ``NA`` when :class:`Index` did not match (:issue:`46551`)
883889
- Bug in :meth:`Series.__setitem__` where setting :attr:`NA` into a numeric-dtype :class:`Series` would incorrectly upcast to object-dtype rather than treating the value as ``np.nan`` (:issue:`44199`)
884890
- Bug in :meth:`DataFrame.loc` when setting values to a column and right hand side is a dictionary (:issue:`47216`)
891+
- Bug in :meth:`DataFrame.loc` when setting a :class:`DataFrame` not aligning index in some cases (:issue:`47578`)
885892
- Bug in :meth:`Series.__setitem__` with ``datetime64[ns]`` dtype, an all-``False`` boolean mask, and an incompatible value incorrectly casting to ``object`` instead of retaining ``datetime64[ns]`` dtype (:issue:`45967`)
886893
- Bug in :meth:`Index.__getitem__` raising ``ValueError`` when indexer is from boolean dtype with ``NA`` (:issue:`45806`)
887894
- Bug in :meth:`Series.__setitem__` losing precision when enlarging :class:`Series` with scalar (:issue:`32346`)
@@ -934,13 +941,15 @@ I/O
934941
- Bug in :func:`read_parquet` when ``engine="fastparquet"`` where the file was not closed on error (:issue:`46555`)
935942
- :meth:`to_html` now excludes the ``border`` attribute from ``<table>`` elements when ``border`` keyword is set to ``False``.
936943
- Bug in :func:`read_sas` with certain types of compressed SAS7BDAT files (:issue:`35545`)
944+
- Bug in :func:`read_excel` not forward filling :class:`MultiIndex` when no names were given (:issue:`47487`)
937945
- Bug in :func:`read_sas` returned ``None`` rather than an empty DataFrame for SAS7BDAT files with zero rows (:issue:`18198`)
938946
- Bug in :class:`StataWriter` where value labels were always written with default encoding (:issue:`46750`)
939947
- Bug in :class:`StataWriterUTF8` where some valid characters were removed from variable names (:issue:`47276`)
940948
- Bug in :meth:`DataFrame.to_excel` when writing an empty dataframe with :class:`MultiIndex` (:issue:`19543`)
941949
- Bug in :func:`read_sas` with RLE-compressed SAS7BDAT files that contain 0x40 control bytes (:issue:`31243`)
942950
- Bug in :func:`read_sas` that scrambled column names (:issue:`31243`)
943-
-
951+
- Bug in :func:`read_sas` with RLE-compressed SAS7BDAT files that contain 0x00 control bytes (:issue:`47099`)
952+
- Bug in :func:`read_parquet` with ``use_nullable_dtypes=True`` where ``float64`` dtype was returned instead of nullable ``Float64`` dtype (:issue:`45694`)
944953

945954
Period
946955
^^^^^^
@@ -995,11 +1004,12 @@ Reshaping
9951004
- Bug in :func:`get_dummies` that selected object and categorical dtypes but not string (:issue:`44965`)
9961005
- Bug in :meth:`DataFrame.align` when aligning a :class:`MultiIndex` to a :class:`Series` with another :class:`MultiIndex` (:issue:`46001`)
9971006
- Bug in concatenation with ``IntegerDtype``, or ``FloatingDtype`` arrays where the resulting dtype did not mirror the behavior of the non-nullable dtypes (:issue:`46379`)
1007+
- Bug in :func:`concat` losing dtype of columns when ``join="outer"`` and ``sort=True`` (:issue:`47329`)
9981008
- Bug in :func:`concat` not sorting the column names when ``None`` is included (:issue:`47331`)
9991009
- Bug in :func:`concat` with identical key leads to error when indexing :class:`MultiIndex` (:issue:`46519`)
10001010
- Bug in :meth:`DataFrame.join` with a list when using suffixes to join DataFrames with duplicate column names (:issue:`46396`)
10011011
- Bug in :meth:`DataFrame.pivot_table` with ``sort=False`` results in sorted index (:issue:`17041`)
1002-
-
1012+
- Bug in :meth:`concat` when ``axis=1`` and ``sort=False`` where the resulting Index was a :class:`Int64Index` instead of a :class:`RangeIndex` (:issue:`46675`)
10031013

10041014
Sparse
10051015
^^^^^^

pandas/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# flake8: noqa
2+
from __future__ import annotations
23

34
__docformat__ = "restructuredtext"
45

@@ -185,7 +186,7 @@
185186
__deprecated_num_index_names = ["Float64Index", "Int64Index", "UInt64Index"]
186187

187188

188-
def __dir__():
189+
def __dir__() -> list[str]:
189190
# GH43028
190191
# Int64Index etc. are deprecated, but we still want them to be available in the dir.
191192
# Remove in Pandas 2.0, when we remove Int64Index etc. from the code base.

pandas/_config/config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
Callable,
6161
Generic,
6262
Iterable,
63+
Iterator,
6364
NamedTuple,
6465
cast,
6566
)
@@ -435,13 +436,13 @@ def __init__(self, *args) -> None:
435436

436437
self.ops = list(zip(args[::2], args[1::2]))
437438

438-
def __enter__(self):
439+
def __enter__(self) -> None:
439440
self.undo = [(pat, _get_option(pat, silent=True)) for pat, val in self.ops]
440441

441442
for pat, val in self.ops:
442443
_set_option(pat, val, silent=True)
443444

444-
def __exit__(self, *args):
445+
def __exit__(self, *args) -> None:
445446
if self.undo:
446447
for pat, val in self.undo:
447448
_set_option(pat, val, silent=True)
@@ -733,7 +734,7 @@ def pp(name: str, ks: Iterable[str]) -> list[str]:
733734

734735

735736
@contextmanager
736-
def config_prefix(prefix):
737+
def config_prefix(prefix) -> Iterator[None]:
737738
"""
738739
contextmanager for multiple invocations of API with a common prefix
739740

pandas/_config/localization.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def set_locale(
3939
particular locale, without globally setting the locale. This probably isn't
4040
thread-safe.
4141
"""
42-
current_locale = locale.getlocale()
42+
# getlocale is not always compliant with setlocale, use setlocale. GH#46595
43+
current_locale = locale.setlocale(lc_var)
4344

4445
try:
4546
locale.setlocale(lc_var, new_locale)

pandas/_libs/algos.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def kth_smallest(numeric_t[::1] arr, Py_ssize_t k) -> numeric_t:
324324

325325
@cython.boundscheck(False)
326326
@cython.wraparound(False)
327+
@cython.cdivision(True)
327328
def nancorr(const float64_t[:, :] mat, bint cov=False, minp=None):
328329
cdef:
329330
Py_ssize_t i, j, xi, yi, N, K
@@ -356,8 +357,8 @@ def nancorr(const float64_t[:, :] mat, bint cov=False, minp=None):
356357
nobs += 1
357358
dx = vx - meanx
358359
dy = vy - meany
359-
meanx += 1 / nobs * dx
360-
meany += 1 / nobs * dy
360+
meanx += 1. / nobs * dx
361+
meany += 1. / nobs * dy
361362
ssqdmx += (vx - meanx) * dx
362363
ssqdmy += (vy - meany) * dy
363364
covxy += (vx - meanx) * dy

pandas/_libs/index.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class BaseMultiIndexCodesEngine:
6969
) -> npt.NDArray[np.intp]: ...
7070

7171
class ExtensionEngine:
72-
def __init__(self, values: "ExtensionArray"): ...
72+
def __init__(self, values: ExtensionArray): ...
7373
def __contains__(self, val: object) -> bool: ...
7474
def get_loc(self, val: object) -> int | slice | np.ndarray: ...
7575
def get_indexer(self, values: np.ndarray) -> npt.NDArray[np.intp]: ...

pandas/_libs/interval.pyi

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ from typing import (
44
Any,
55
Generic,
66
TypeVar,
7-
Union,
87
overload,
98
)
109

@@ -66,6 +65,8 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
6665
def right(self: Interval[_OrderableT]) -> _OrderableT: ...
6766
@property
6867
def inclusive(self) -> IntervalClosedType: ...
68+
@property
69+
def closed(self) -> IntervalClosedType: ...
6970
mid: _MidDescriptor
7071
length: _LengthDescriptor
7172
def __init__(
@@ -81,11 +82,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
8182
self: Interval[_OrderableTimesT], key: _OrderableTimesT
8283
) -> bool: ...
8384
@overload
84-
def __contains__(
85-
self: Interval[_OrderableScalarT], key: Union[int, float]
86-
) -> bool: ...
87-
def __repr__(self) -> str: ...
88-
def __str__(self) -> str: ...
85+
def __contains__(self: Interval[_OrderableScalarT], key: int | float) -> bool: ...
8986
@overload
9087
def __add__(
9188
self: Interval[_OrderableTimesT], y: Timedelta
@@ -95,7 +92,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
9592
self: Interval[int], y: _OrderableScalarT
9693
) -> Interval[_OrderableScalarT]: ...
9794
@overload
98-
def __add__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
95+
def __add__(self: Interval[float], y: int | float) -> Interval[float]: ...
9996
@overload
10097
def __radd__(
10198
self: Interval[_OrderableTimesT], y: Timedelta
@@ -105,7 +102,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
105102
self: Interval[int], y: _OrderableScalarT
106103
) -> Interval[_OrderableScalarT]: ...
107104
@overload
108-
def __radd__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
105+
def __radd__(self: Interval[float], y: int | float) -> Interval[float]: ...
109106
@overload
110107
def __sub__(
111108
self: Interval[_OrderableTimesT], y: Timedelta
@@ -115,7 +112,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
115112
self: Interval[int], y: _OrderableScalarT
116113
) -> Interval[_OrderableScalarT]: ...
117114
@overload
118-
def __sub__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
115+
def __sub__(self: Interval[float], y: int | float) -> Interval[float]: ...
119116
@overload
120117
def __rsub__(
121118
self: Interval[_OrderableTimesT], y: Timedelta
@@ -125,33 +122,31 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
125122
self: Interval[int], y: _OrderableScalarT
126123
) -> Interval[_OrderableScalarT]: ...
127124
@overload
128-
def __rsub__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
125+
def __rsub__(self: Interval[float], y: int | float) -> Interval[float]: ...
129126
@overload
130127
def __mul__(
131128
self: Interval[int], y: _OrderableScalarT
132129
) -> Interval[_OrderableScalarT]: ...
133130
@overload
134-
def __mul__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
131+
def __mul__(self: Interval[float], y: int | float) -> Interval[float]: ...
135132
@overload
136133
def __rmul__(
137134
self: Interval[int], y: _OrderableScalarT
138135
) -> Interval[_OrderableScalarT]: ...
139136
@overload
140-
def __rmul__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
137+
def __rmul__(self: Interval[float], y: int | float) -> Interval[float]: ...
141138
@overload
142139
def __truediv__(
143140
self: Interval[int], y: _OrderableScalarT
144141
) -> Interval[_OrderableScalarT]: ...
145142
@overload
146-
def __truediv__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
143+
def __truediv__(self: Interval[float], y: int | float) -> Interval[float]: ...
147144
@overload
148145
def __floordiv__(
149146
self: Interval[int], y: _OrderableScalarT
150147
) -> Interval[_OrderableScalarT]: ...
151148
@overload
152-
def __floordiv__(
153-
self: Interval[float], y: Union[int, float]
154-
) -> Interval[float]: ...
149+
def __floordiv__(self: Interval[float], y: int | float) -> Interval[float]: ...
155150
def overlaps(self: Interval[_OrderableT], other: Interval[_OrderableT]) -> bool: ...
156151

157152
def intervals_to_interval_bounds(

0 commit comments

Comments
 (0)