You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cat >project.py <<EOF
from functools import singledispatch
@singledispatch
def foo(x): "something"
@foo.register(int)
@foo.register(float)
def _(x): "a number"
EOF
sphinx-apidoc . -o . -F -A me -V 0.0
PYTHONPATH=. make html
…ndered
When multiple singledispatch decorators are stacked, the first typehints
are copied to the subsequent definitions unexpectedly.
Now autodoc generates a dummy function not to affect typehints to
subsequent functions.
…ndered
When multiple singledispatch decorators are stacked, the first typehints
are copied to the subsequent definitions unexpectedly.
Now autodoc generates a dummy function not to affect typehints to
subsequent functions.
tk0miya
added a commit
to tk0miya/sphinx
that referenced
this issue
May 2, 2021
…ndered
When multiple singledispatch decorators are stacked, the first typehints
are copied to the subsequent definitions unexpectedly.
Now autodoc generates a dummy function not to affect typehints to
subsequent functions.
Describe the bug
When multiple
@functools.singledispatch
decorators are stacked (as documented by the stdlib docs at https://docs.python.org/3/library/functools.html#functools.singledispatch), the type annotations reported by sphinx are incorrect.To Reproduce
Steps to reproduce the behavior:
then open _build/html/project.html: you get
Expected behavior
The correct overloads are
Your project
N/A
Screenshots
N/A
Environment info
Additional context
N/A
The text was updated successfully, but these errors were encountered: