Skip to content

TYP final _take_with_is_copy is overridden in series #40974

Closed
@MarcoGorelli

Description

@MarcoGorelli

This method is declared as final:

pandas/pandas/core/generic.py

Lines 3629 to 3630 in 526d52f

@final
def _take_with_is_copy(self: FrameOrSeries, indices, axis=0) -> FrameOrSeries:

It's then overridden in series:

def _take_with_is_copy(self, indices, axis=0):

The reason mypy doesn't detect this failure is that the override in series in untyped, and so mypy doesn't check it


@jbrockmendel do you know which one is correct? Remove final or remove the override?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Typingtype annotations, mypy/pyright type checkinggood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions