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

请问 Python 内置函数 help()的 C 代码在哪里?

  •  
  •   Deteriorator · Jun 24, 2020 · 2600 views
    This topic created in 2176 days ago, the information mentioned may be changed or developed.
    如题,内置函数一般在 cpython 源码中的 bltinmodule.c 文件中,为啥找不到 help()这个内置函数的源代码?请问其到底在哪里?
    4 replies    2020-06-24 21:00:23 +08:00
    ttvast
        1
    ttvast  
       Jun 24, 2020   ❤️ 1
    site.py 里面
    Deteriorator
        2
    Deteriorator  
    OP
       Jun 24, 2020
    @ttvast 多谢,最终调用的是 pydoc 中的 help,竟然不是 C 编写的
    Vegetable
        3
    Vegetable  
       Jun 24, 2020
    File: /usr/lib/python3.6/_sitebuiltins.py
    sarvatathagata
        4
    sarvatathagata  
       Jun 24, 2020   ❤️ 1
    如果你用的是 ipython 的话,输入 help??就可以看到 help 源码的位置和具体实现了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1041 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 19:04 · PVG 03:04 · LAX 12:04 · JFK 15:04
    ♥ Do have faith in what you're doing.