Skip to content

Regression in mypy 0.930: Cannot override writable attribute "__module__" with a final one #11820

@dvarrazzo

Description

@dvarrazzo

Bug Report

The following code is reported as error by mypy 0.930 (Python 3.8). It seems correct, and was considered correct so far:

from enum import Enum

class PyFormat(str, Enum):
    __module__ = "psycopg.adapt"
    AUTO = "s"
    TEXT = "t"
    BINARY = "b"

The error reported is:

$ mypy test_mypy.py 
test_mypy.py:4: error: Cannot override writable attribute "__module__" with a final one  [misc]

which I don't even know what means...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions