9 Feb
2020
9 Feb
'20
1:38 p.m.
On 2020-02-09 10:28 a.m., Anders Hovmöller wrote:
On 9 Feb 2020, at 14:01, Soni L. <fakedme+py@gmail.com> wrote:
into this:
[snip]
def my_fn(@MyTrait x): x.x()
Can't you look at typing info or something instead? That is a lot of boilerplate and ceremony even after your proposed addition.
So:
@traits def my_fn(x: MyTrait): x.x()
/ Anders
not happy about how that looks and I'd need to create wrapper functions and deal with mixed args and kwargs. as far as I know there aren't libraries that do it for me, either. I'd rather have arg decorators tbh. they feel more natural than hacking on the type annotations.