gpt4 book ai didi

python 信息函数 : where is it?

转载 作者:太空宇宙 更新时间:2023-11-03 13:18:45 25 4
gpt4 key购买 nike

来自 Dive into Python :

Python has a function called info. Try it yourself and skim through the list now.

>>> from apihelper import info
>>> import __builtin__
>>> info(__builtin__, 20)
ArithmeticError Base class for arithmetic errors.
AssertionError Assertion failed.
AttributeError Attribute not found.
EOFError Read beyond end of file.
EnvironmentError Base class for I/O related errors.
Exception Common base class for all exceptions.
FloatingPointError Floating point operation failed.
IOError I/O operation failed.

事实证明,Python没有有一个叫做info的函数。这本书指的是什么?

最佳答案

我不知道为什么 Dive Into Python 声称“Python 有一个名为 info 的函数”,但这显然不是真的。

apihelper.py(info 是从中导入的)已在本书前面描述,in section 4.1 ,并且只是 Mark Pilgrim 为与 Dive Into Python 一起使用而编写的一个模块。该 apihelper 模块显然确实包含一个 info 函数,该函数执行您链接的第 4.3.3 节中声明的内容。

关于python 信息函数 : where is it?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20948413/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com