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
from __future__ importannotationsimportattr@attr.define()classA:
n: int@attr.define()classB(A):
passattr.resolve_types(A)
attr.resolve_types(B)
print(attr.fields(B))
I believe this is because B is somehow inheriting A's __attrs_types_resolved__, even though it gets set later -- which means that it never had its types resolved, but it thinks it has.
This came up when I was using cattrs (I raised an issue there about a trouble I had debugging too :^), which means I do not control the resolution order of types without applying a attr.resolve_types decorator to every class (which might not work -- I'm not sure all my class declarations are in order either...)
The text was updated successfully, but these errors were encountered:
Reproduction case:
I believe this is because
B
is somehow inheritingA
's__attrs_types_resolved__
, even though it gets set later -- which means that it never had its types resolved, but it thinks it has.This came up when I was using cattrs (I raised an issue there about a trouble I had debugging too :^), which means I do not control the resolution order of types without applying a
attr.resolve_types
decorator to every class (which might not work -- I'm not sure all my class declarations are in order either...)The text was updated successfully, but these errors were encountered: