Skip to content

Spurious [override-error] hit #1917

Open
@wyattscarpenter

Description

@wyattscarpenter

When I run pytype on https://github.com/wyattscarpenter/streamlit-profiler I get an error on this line, due to using a typing_extensions.override annotation: https://github.com/wyattscarpenter/streamlit-profiler/blob/1da5e6eb4b5d4deea1111dffc8fa2d9fe82ccecc/wfork_streamlit_profiler/__init__.py#L22

streamlit-profiler\wfork_streamlit_profiler\__init__.py:22:5: error: in Profiler: Attribute 'stop' not found on any parent class [override-error]

    def stop(self) -> Session:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
        session = super().stop()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


        if self._auto_output_on_stop:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            self.output_streamlit()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


        return session
~~~~~~~~~~~~~~~~~~~~~~


For more details, see https://google.github.io/pytype/errors.html#override-error
ninja: build stopped: subcommand failed.
Leaving directory '.pytype'

This is weird, because the class I'm inheriting from, https://github.com/joerick/pyinstrument/blob/b04ab301cac954f6a026af55f6949416ceddbe7f/pyinstrument/profiler.py#L168, does have a stop()

Pytype version: 2024.10.11

By the time you read this, I've added a #type: ignore[override-error] to the line to work around this problem.

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