我目前正在使用Pyzo在Python 3.6中创建一个新类,并且我创建的一些实例方法在模块的帮助部分中并未显示。为什么会这样?
以下是代码和帮助部分:
help(Polynom)
所以这是我的班级。这是文件中唯一写的内容。当我执行文件并在命令行管理器中输入Help on class Polynom in module __main__:
class Polynom(builtins.object)
| A way to represent polynoms
|
| Methods defined here:
|
| __init__(self, *coeff)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| prod_sc(P, k)
| Multiply P by a number k.
|
| verif_pln(f)
| Decorator that verifies
| that the arguments given to f are polynoms.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| degre = functools.partial(<function update_wrapper at 0x...oc__', '__a...
| partial(func, *args, **keywords) - new function with partial application
| of the given arguments and keywords.
|
| somme = functools.partial(<function update_wrapper at 0x...oc__', '__a...
| partial(func, *args, **keywords) - new function with partial application
| of the given arguments and keywords.
时,我得到的是:
degre
所以我用somme
装饰verif_pln
和<html>
<head>
</head>
<body>
<div class="hello-world">
<h1>Hello World</h1>
</div>
</body>
</html>
,现在它们不再作为方法出现了。为什么?它们变成了什么?这是一个问题,如果是,我该如何解决?