Skip to content

Docstring for enum is not inferred as string. #5483

@qria

Description

@qria

Docstring for enum.Enum is inferred as the enum class itself, instead of str.

import enum

class A(enum.Enum):
    """Docstring"""

reveal_type(A.__doc__)   # <string>:7: error: Revealed type is '__main__.A'

Tested with mypy 6.2.0, python 3.6.1

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions