Skip to content

False negative: override of @final property #9795

Description

@erictraut

The typing spec indicates that @final should be enforced for properties, but pyright doesn't emit an error in this case.

from typing import final


class Base:
    @final
    @property
    def prop(self) -> int:
        return 1


class Child(Base):
    # This should result in an error.
    @property
    def prop(self) -> int:
        return 2

Refer to this thread.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions