Skip to content

Adding runtime_checkable to AttrsInstance #1388

Open
@ryan-minato

Description

Is it possible to add the runtime_checkable decorator to AttrsInstance protocol?

class AttrsInstance(Protocol):
pass

In my project, I am working on a decorator that automates converting a dict into an AttrsInstance.
To perform reflection checks on input definitions, I found myself needing to subclass AttrsInstance without modifying it—just to add the runtime_checkable decorator.
It would be incredibly helpful if the attrs library's definition already included runtime_checkable.

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