You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, in this case, it would not be trouble to re-annotate "foo" as "foo: str" in the child class as well - but our classes use heavy/multi-level annotations like:
We have dozens of such required parameters - it would be a great hassle to keep re-annotating them in every child class that provides a new default value. It would also be almost impossible to keep track of all re-annotations, as the number of child classes is growing every day. The whole idea of using attrs was to avoid having to re-annotate the arguments in every child class. Is it possible to achieve with the current framework? If not, can this be implemented?
The text was updated successfully, but these errors were encountered:
R0ll1ngSt0ne
changed the title
Inherit annotation type from base class
Inherit annotation type from base class that defines new default value
Apr 4, 2022
Consider this code:
When compiled, this fails with:
Yes, in this case, it would not be trouble to re-annotate "foo" as "foo: str" in the child class as well - but our classes use heavy/multi-level annotations like:
We have dozens of such required parameters - it would be a great hassle to keep re-annotating them in every child class that provides a new default value. It would also be almost impossible to keep track of all re-annotations, as the number of child classes is growing every day. The whole idea of using attrs was to avoid having to re-annotate the arguments in every child class. Is it possible to achieve with the current framework? If not, can this be implemented?
The text was updated successfully, but these errors were encountered: