Skip to content

(🐞) Variable in dataclass body has value of type Field when mypy thinks it's int (or whatever) #13180

Open
@KotlinIsland

Description

@KotlinIsland
from dataclasses import dataclass, field

@dataclass
class A:
    a: int = field(default=1)
    print(a + 1)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions