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.
_sentinel = object()
def foo(param1=_sentinel):
...
This would allow you to call foo(param1=None)
and be able to make the difference between a call like foo()
.
The problem is that when Sphinx does document the method it will write something like
mymodule.foo(param1=<object object at 0x108c1a520>)
How can I convince Sphinx to have a user friendly output for these functions?
Note, Imagine how the documentations look if you have 3-4 parameters using the sentinel approach.