On 2020-02-09 10:28 a.m., Anders Hovmöller wrote:

> On 9 Feb 2020, at 14:01, Soni L. <fakedme...@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.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/6NGVI64UO2N6T4YSOE25VX3Q4HKQRMTK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to