Skip to content
This repository was archived by the owner on Jun 19, 2020. It is now read-only.
This repository was archived by the owner on Jun 19, 2020. It is now read-only.

Cannot override writable attribute with a final one #28

@fr0der1c

Description

@fr0der1c

The below code should pass the check:

class MongoDAOBase(abc.ABC):
    collection_name: str = NotImplemented

    @classmethod
    @abc.abstractmethod
    def create_index(cls) -> None:
        pass


class PrivacySettingsDAO(MongoDAOBase):
    collection_name: Final = "privacy_settings" # complains

    @classmethod
    def create_index(cls) -> None:
        pass

However, a T484 Cannot override writable attribute "collection_name" with a final oneis raised. This problem seems to be introduced recently. My local version (which is older) of flake8-mypy and mypy does not complain, but it fails in CI environment (which gets later version). I'm not sure if this is a flake8-mypy problem or mypy problem, so I just ask here first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions