Open
Description
import attr
@attr.s
class Bar:
b = attr.ib()
@classmethod
def make(cls, one: int) -> 'Bar':
return cls(one)
@attr.s
class Foo:
a = attr.ib(converter=Bar.make)
error: Unsupported converter, only named functions and types are currently supported
Attrs is perfectly happy with make
>>> Foo(1)
Foo(a=Bar(b=1))
Granted the converter limitations are a known issue, I couldn't find this use-case covered anywhere.