Describe the bug
I am using a function wrapper to produce multiple functions from a stub one, and set the produced function with different names and docs. However, the produced functions are not displayed in the page generated from mkdocstrings. If I set show_if_no_docstring
, it appears but without any document.
The function wrapper mypartial
is as below.
def mypartial(name: str, doc: str, f, *args, **kvs):
def g(*_args, **_kvs):
return f(*args, *_args, **kvs, **_kvs)
g.__name__ = name
g.__doc__ = doc
g.__wrapped__ = f # Whether to set __wrapped__ does not change the result
return g
xxx = mypartial("xxx", "xxx", lambda x, y: x + y, 1)
Surprisingly to me, this piece of code works. But if I import mypartial
from another module (just another file aside), it does not. I am wondering what is the difference whether mypartial
is defined in another module.
I noticed there is some discussions in mkdocstrings/mkdocstrings#162. But my case is a little bit different, because my decorated function has a different name and doc from the original one.
To Reproduce
Run the code above, but define mypartial
in a separated file.
Expected behavior
Function xxx
should be documented
Screenshots
The function xxx
just disappears.
System (please complete the following information):
pytkdocs
version 0.16.1Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too