Description
This being a consciously minimal (read: heinous) hack job at the moment, little of a decorated class' metadata survives the transformation. Tab complete doesn't work, nothing useful shown on hover, etc.
(Note I am talking about Python class metadata, not attrs
field metadata.)
We want all the original metadata, modified with some new attributes: name
, parent
, etc.
I think we don't need to wrap/replace the class init method as is done now. Better to build on attrs
as much as possible*. @xattree
can wrap @attrs.define()
, use field_transformer
to add the new fields, and use a post-init hook to create the datatree? With that (plus maybe functools.wrap
?) I think attrs
will do the rest, and metadata will work.
*To guarantee metadata, attrs
rewrites the classes by hand, compiles them, and registers them globally. Trickery best left to experts.