Skip to content

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

Open

Description

@KotlinIsland
from dataclasses import dataclass, field

@dataclass
class A:
    a: int = field(default=1)
    print(a + 1)
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

    bugpriority-2-lowtopic-dataclasses

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions