推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
wuwukai007
V2EX  ›  Python

今天刚发现 Python 简单的递归用 reduce 实现感觉蛮简洁的

  •  
  •   wuwukai007 · Jan 13, 2023 · 3664 views
    This topic created in 1252 days ago, the information mentioned may be changed or developed.
    8 replies    2023-01-17 15:22:34 +08:00
    n0099
        1
    n0099  
       Jan 13, 2023
    恭喜阁下已经入门了 FP (函数式编程)思维
    eccstartup
        2
    eccstartup  
       Jan 13, 2023
    不然呢
    zhy0216
        3
    zhy0216  
       Jan 13, 2023
    python lambda 不能做 iife (因为缩进语法原因?)
    一点小遗憾
    JasonLaw
        4
    JasonLaw  
       Jan 13, 2023
    @zhy0216 #3 什么是“python lambda 不能做 iife”?
    n0099
        5
    n0099  
       Jan 13, 2023   ❤️ 2
    #3 @zhy0216 可以吧
    https://pythonsimplified.com/everything-you-need-to-know-about-python-lambda-functions/
    > Another way you can invoke the Lambda function is through Immediately Invoked Function Expression (IIFE). However, this is not a recommended use of calling lambda expression. You don’t see this method being used anywhere. I have mentioned this for informational purposes only.
    > >>> print((lambda x: x**2)(5))
    > 25

    https://elfi-y.medium.com/python-lambda-%CE%BB-6c62a5427913
    > We can invoke them directly in Immediately Invoked Function Expressions (IIFE) like:
    > (function (a, b) {return a + b })(1, 2); // 3
    > ((a,b) => (a+b))(1, 2); // 3
    julyclyde
        6
    julyclyde  
       Jan 16, 2023
    reduce 是不是那个什么“柯里化”什么偏函数之类的
    NoOneNoBody
        7
    NoOneNoBody  
       Jan 16, 2023
    python 一些内置函数,性能还不如表达式,当然前者简洁和阅读性强一些
    不懂源码,只感觉 python 的循环表达式比较神奇,看上去只是循环,却比一段循环代码高效很多
    stonesirsir
        8
    stonesirsir  
       Jan 17, 2023
    为啥看不到了呢?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2636 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 13:25 · PVG 21:25 · LAX 06:25 · JFK 09:25
    ♥ Do have faith in what you're doing.