Skip to content

Rendering updated type information on function with return type changed by decorator #663

Closed Answered by pawamoy
higorc-mck asked this question in Q&A
Discussion options

You must be logged in to vote

At the time #162 was open, we were still using pytkdocs (dynamic analysis) and not Griffe (hybrid static/dynamic analysis) to load data from Python code. So the answers in #162 aren't relevant anymore.

What happens in your case is that Griffe by default uses static analysis to read the signature of the function, but this signature is actually changed dynamically by the decorator. Griffe is not able to follow such dynamic changes statically. So you'd have to force dynamic analysis on this particular object, or on the whole package. In the first case, you could draw inspiration from this example. In the second case, you'd have to wait for us to implement an option to force inspection 🙂

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by higorc-mck
Comment options

You must be logged in to vote
0 replies
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