[Python-ideas] Re: Function call in (kw)args

2020-02-10 Thread Soni L.
On 2020-02-10 2:03 a.m., Anders Hovmöller wrote: > On 10 Feb 2020, at 04:18, Soni L. wrote: > > Traits are composition tho. I think you missed something I said. In that case I think we all missed it and then isn't that on you? Remember it is you who are trying to convince the list so any

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Anders Hovmöller
> On 10 Feb 2020, at 04:18, Soni L. wrote: > > Traits are composition tho. I think you missed something I said. In that case I think we all missed it and then isn't that on you? Remember it is you who are trying to convince the list so any information missed or misunderstood is your

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Soni L.
On 2020-02-09 5:31 p.m., Chris Angelico wrote: On Mon, Feb 10, 2020 at 7:21 AM Soni L. wrote: > > > Maybe if you had a good example that wasn’t an implicit type cast, this similarity would be an argument against using annotations rather than an argument for using them? But it’s hard to know

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Andrew Barnert via Python-ideas
>>> On Feb 9, 2020, at 12:20, Soni L. wrote: >> On 2020-02-09 4:46 p.m., Andrew Barnert wrote: >>> On Feb 9, 2020, at 05:40, Soni L. wrote: I'd rather have arg decorators tbh. they feel more natural than hacking on the type annotations. >> Annotations look a lot more natural to me

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Chris Angelico
On Mon, Feb 10, 2020 at 7:21 AM Soni L. wrote: > > > Maybe if you had a good example that wasn’t an implicit type cast, this > > similarity would be an argument against using annotations rather than an > > argument for using them? But it’s hard to know without seeing such an > > example, or

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Soni L.
On 2020-02-09 4:46 p.m., Andrew Barnert wrote: > On Feb 9, 2020, at 05:40, Soni L. wrote: > > I'd rather have arg decorators tbh. they feel more natural than hacking on the type annotations. Annotations look a lot more natural to me here. Maybe that’s because your only example (besides

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Andrew Barnert via Python-ideas
On Feb 9, 2020, at 11:49, Andrew Barnert wrote: > > If there isn’t a library that puts it all together the way you want I figured there probably was, so I decided to take a look. I got a whole page of possibly useful things, and the first one I looked at, typical, shows this as its first

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Andrew Barnert via Python-ideas
> On Feb 9, 2020, at 05:40, Soni L. wrote: > > I'd rather have arg decorators tbh. they feel more natural than hacking on > the type annotations. Annotations look a lot more natural to me here. Maybe that’s because your only example (besides the useless original one) looks like an implicit

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Soni L.
On 2020-02-09 10:28 a.m., Anders Hovmöller wrote: > On 9 Feb 2020, at 14:01, Soni L. 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

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Anders Hovmöller
> On 9 Feb 2020, at 14:01, Soni L. 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() /

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Soni L.
On 2020-02-09 9:44 a.m., Eric V. Smith wrote: On 2/9/2020 7:34 AM, Soni L. wrote: I propose that: def foo(print(x)):   pass becomes: def foo(x):   x = print(x)   pass or, alternatively we could have decorators in function args: def foo(@print x):   pass which would probably be more

[Python-ideas] Re: Function call in (kw)args

2020-02-09 Thread Eric V. Smith
On 2/9/2020 7:34 AM, Soni L. wrote: I propose that: def foo(print(x)):   pass becomes: def foo(x):   x = print(x)   pass or, alternatively we could have decorators in function args: def foo(@print x):   pass which would probably be more aligned with the rest of python actually. anyway,