我知道pydoc可以为python类的public(不是以_开头)方法生成文档。但是如何生成属性文档?
以下是一个示例:您可以看到pydoc为3种方法和2种属性创建了domentation:
__ dict__
__ weakref __
所以,我的问题可以分成小问题。
class ImageReader(builtins.object) | Helper class that provides TensorFlow image coding utilities. | | Methods defined here: | | __init__(self) | Create a Reader for reading image information. | | decode_image(self, sess, image_data) | Decode jpeg image. | | read_image_dims(self, sess, image_data) | Read dimension of image. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined)