chiark / gitweb /
documentation/python: revisit None in function return type annotations.
authorVladimír Vondruš <mosra@centrum.cz>
Fri, 23 Aug 2019 13:45:20 +0000 (15:45 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sun, 25 Aug 2019 10:38:27 +0000 (12:38 +0200)
commitcc916669cb349dbcd4771cf130be8fea65a5543e
tree5077b15e9ed457a585f98fe5799c4ddb86c251a3
parentc3a57be39b749e004716e4cc8830b261b2ad0d45
documentation/python: revisit None in function return type annotations.

Until now it was ignored in pybind return annotations as it seemed to be
superfluous. OTOH, while the pybind function is fully annotated, it's
often not clear which function comes from pybind and which from pure
python code, meaning it's not clear if the return type is None or the
return type annotation is just missing.

Additionally, the pure python annotations were showing None as NoneType,
which is too verbose. According to PEP484 type(None) and None are
equivalent, so patching the output to show None instead of NoneType,
making it also consistent with pybind.
documentation/python.py
documentation/test_python/inspect_annotations/inspect_annotations.html
documentation/test_python/inspect_annotations/inspect_annotations.py
documentation/test_python/pybind_signatures/pybind_signatures.MyClass.html
documentation/test_python/pybind_signatures/pybind_signatures.cpp
documentation/test_python/pybind_signatures/pybind_signatures.html
documentation/test_python/pybind_type_links/pybind_type_links.Foo.html
documentation/test_python/pybind_type_links/pybind_type_links.html
documentation/test_python/test_pybind.py