问题
I'm seeing Python class attributes incorrectly assigned the value, None
, in Sphinx autodoc
generated documentation, when Traits are used.
I have a simple test case with instructions for observing the error, here:
https://github.com/capn-freako/SphinxTest
It shows that:
- When
object
is used as the superclass, andint
is the class attribute's type, the generated documentation is as expected. - When
HasTraits
is used as the superclass andInt
is the class attribute's type, the generated documentation is incorrect.
来源:https://stackoverflow.com/questions/47932680/sphinx-autodoc-incorrectly-assigning-value-none-to-class-attributes-when-trai