Skip to content

Warning with decorators. #243

Closed Answered by pawamoy
AntoineD asked this question in Q&A
Feb 29, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hello, I'd say it is caused by a combination of your wrapper and your docstring-inheritance extension. I'd recommend using functools.wraps on your wrapper function, see https://mkdocstrings.github.io/troubleshooting/#my-wrapped-function-shows-documentationcode-for-its-wrapper-instead-of-its-own. Otherwise your function docstrings is overwritten by the wrapper docstring.

Also, check out our official docstring-inheritance extension: https://mkdocstrings.github.io/griffe-inherited-docstrings/. It's probably less specific than your own though, but maybe will work for you too. One benefit is that it works statically too, so won't require dynamically importing objects like you do in your own ex…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@AntoineD
Comment options

@AntoineD
Comment options

@pawamoy
Comment options

Answer selected by AntoineD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants