Documenting with Sphinx python methods that do have default parameters with sentinel objects?

前端 未结 3 2066
北海茫月
北海茫月 2021-01-20 21:48

If you want to be able to allow people to call some methods using None you have to do use a sentinel object when you define the method.

 _senti         


        
3条回答
  •  礼貌的吻别
    2021-01-20 22:26

    This can be handled by manually specifying function signature in autodoc directive, e.g.:

    .. automodule:: pymorphy.contrib.tokenizers
    
        .. autofunction:: extract_tokens(foo, bar)
    
        .. autofunction:: extract_words
    

提交回复
热议问题