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.
Is it possible to add the
runtime_checkabledecorator toAttrsInstanceprotocol?attrs/src/attr/__init__.py
Lines 37 to 38 in 598494a
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
AttrsInstancewithout modifying it—just to add theruntime_checkabledecorator.It would be incredibly helpful if the attrs library's definition already included
runtime_checkable.