[Python-ideas] (no subject)

Steven D'Aprano steve at pearwood.info
Wed May 6 18:17:55 CEST 2015


On Wed, May 06, 2015 at 09:01:26AM -0700, Guido van Rossum wrote:
> On Wed, May 6, 2015 at 8:48 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> 
> > Compared to asynchronous code, I would say function composition is
> > trivial. Anyone who can learn the correspondence
> >
> >     (a @ b)(arg)  <=> a(b(arg))
> >
> > can deal with it.
> 
> 
> Personally, I can certainly "deal" with it, but it'll never come naturally
> to me. As soon as I see code like this I have to mentally pick it apart and
> rewrite it in the more familiar form before I understand what's going on.

Yes, I remember you dislike reduce() as well :-)


> Maybe if I needed this frequently I'd learn to fly with it, but I just
> don't see the need that often. I see things like f().g() much more often
> than f(g()).

Perhaps it has something to do with my background in mathematics, I see 
things like f(g()) all the time.

I will admit that, going back to my teens in high school, it took a 
little while for the "f o g" notation to really sink in. I remember 
writing study notes to learn it.

But I still have to look up the order of list.insert() every single time 
I use it, and I can never remember whether functools.partial applies its 
arguments from the left or the right, and let's not even mention list 
comps with more than one "for" clause. Some things just never become 
entirely comfortable to some people.

I look forward to many weeks or months trying to wrap my head around 
asyncronous programming too :-)


-- 
Steve


More information about the Python-ideas mailing list