Reproduction case:
from __future__ import annotations
import attr
@attr.define()
class A:
n: int
@attr.define()
class B(A):
pass
attr.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...)
Reproduction case:
I believe this is because
Bis 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_typesdecorator to every class (which might not work -- I'm not sure all my class declarations are in order either...)