8000 Support string type annotations · Issue #92 · ericvsmith/dataclasses · GitHub
[go: up one dir, main page]

Skip to content
Support string type annotations #92
@ericvsmith

Description

@ericvsmith

The implementation needs some work with regards to string annotations. This only affects ClassVar and InitVar, since other annotations are ignored.

@dataclass
class C:
   context: "InitVar[context]"
   count: "ClassVar[Counter]"

This is all the more important with regards to PEP 563, "Postponed Evaluation of Annotations".

I'd like to keep the property that typing isn't imported by dataclasses.py, so maybe I'll resort to inspecting the string. I'll probably wait until PEP 563 is finalized before doing anything about this.

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

      0