Map list by partial function vs lambda

前端 未结 3 1734
一生所求
一生所求 2021-02-05 11:24

I was wondering whether for most examples it is more \'pythonic\' to use lambda or the partial function?

For example, I might want to apply imap on some list, like add 3

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-05 12:25

    In the given example, lambda seems most appropriate. It's also easier on the eyes.

    I have never seen the use of partial functions in the wild.

提交回复
热议问题