Skip to content

don't use __annotations__ #288

@glyph

Description

@glyph

anns = getattr(cls, "__annotations__", {})
uses __annotations__

However, it looks as though an upcoming incompatible change to Python will change __annotations__ into a list of strings.

It seems like the correct public API to use to retrieve the information attrs wants would be get_type_hints.

As a bonus, fixing this might make #265 easier to implement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions