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
Unless I am mistaken, one cannot use attrs.fields on a attrs class object, unlike attrs.has. The workaround is simple, either attrs.fields(type(obj)) or obj.__attrs_attrs__. It would be nice to be able to use attrs.fields directly.
@attrs.defineclassHello():
a=attrs.field()
b=attrs.field()
# This worksattrs.fields(Hello)
# But this doesn't (yet)attrs.fields(Hello(1, 2))
# NB: this works thoughattrs.has(Hello)
attrs.has(Hello(1, 2))