推荐学习书目
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
kevinyoung
V2EX  ›  Python

求教关于 functools.partial 冻结参数顺序的问题

  •  
  •   kevinyoung · Sep 19, 2014 · 3453 views
    This topic created in 4281 days ago, the information mentioned may be changed or developed.
    函数有三个参数:
    def func(a, b, c):
    ____pass

    现在我想把b冻结起来,用functools.partial如何实现?
    2 replies    2014-09-19 11:17:48 +08:00
    lianghui
        2
    lianghui  
       Sep 19, 2014   ❤️ 1
    写的太罗嗦了:

    callback = lambda a,c: func(a,"blablablabla", c)
    callback("a", "c")
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5436 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 01:16 · PVG 09:16 · LAX 18:16 · JFK 21:16
    ♥ Do have faith in what you're doing.