Skip to content

Sync with upcoming typeshed changes making slice hashable #1017

@bersbersbers

Description

@bersbersbers

As a heads-up:

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/frame.pyi:608: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [overload-overlap]

I guess this is acceptable - pandas-stubs has # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload] in line 606 already, and with this PR, they likely need it in line 608 as well:

@overload
def __getitem__(self, key: Scalar | tuple[Hashable, ...]) -> Series: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __getitem__(self, key: Iterable[Hashable] | slice) -> DataFrame: ...
@overload
def __getitem__(self, key: Hashable) -> Series: ...

Originally posted by @bersbersbers in python/typeshed#12832 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions