Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docstring not picked up when using typing.overload #217

Closed
joelberkeley-secondmind opened this issue Jun 9, 2020 · 1 comment · Fixed by #239
Closed

Docstring not picked up when using typing.overload #217

joelberkeley-secondmind opened this issue Jun 9, 2020 · 1 comment · Fixed by #239

Comments

@joelberkeley-secondmind
Copy link

joelberkeley-secondmind commented Jun 9, 2020

When I use typing.overload on a method, I don't get any documentation for that method, presumably because the first variant of that method is empty this is slightly incorrect - see comment below

If I move the docstring to the first overloaded variant (or copy it to all the variants), it builds the docstring, but it shows the type signature of only the first variant whereas it should show all of them

I'm using

Sphinx 3.0.4
sphinx-autoapi 1.3.0
sphinx-rtd-theme 0.4.3

my conf.py

project = ...  # removed
copyright = ...  # removed
author = ...  # removed
release = "v0.1.0"

extensions = []
add_module_names = False

# sphinx-autoapi
extensions.append('autoapi.extension')
autoapi_dirs = ['../package_name']
autoapi_python_class_content = "both"
autoapi_options = [
    'members',
    'undoc-members',  # this is temporary until we add docstrings across the codebase
    'show-inheritance',
    'show-module-summary',
    'special-members',
    'imported-members',
    'inherited-members',
]

# intersphinx
extensions.append('sphinx.ext.intersphinx')
intersphinx_mapping = {
    'python': ('https://docs.python.org/3/', None),
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# If True, show link to rst source on rendered HTML pages
html_show_sourcelink = False

# theme-specific options. see theme docs for more info
html_theme_options = {
    "collapse_navigation": False,
    "titles_only": True,
}
@joelberkeley-secondmind
Copy link
Author

joelberkeley-secondmind commented Jun 13, 2020

When I use typing.overload on a method, I don't get any documentation for that method, presumably because the first variant of that method is empty

should be

When I use typing.overload on a method, and document the implementation of the method (rather than the type-hinted stub variants), I see the function signature of the first variant, but no docstring content, presumably because the first variant of that method is empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants