Skip to main content

Sphinx extension to render inherited overloads with autodoc.

Project description

Sphinx: Render inherited overloads with autodoc

This extension works around a small issue in Sphinx where autodoc does not show inherited @overload signatures, by manually resolving overloads during the autodoc-process-signature event. Dynamically, the overloads for a function can only be obtained using the typing.get_overloads() function, which was introduced in Python 3.11. The latter is therefore a hard requirement.

Installation

For testing, you can install the sphinxcontrib.autodoc_inherit_overload package from pip:

pip install sphinxcontrib.autodoc_inherit_overload

When adding the package to your dependencies, make sure you guard against incorrect Python versions:

sphinxcontrib.autodoc_inherit_overload; python_version>='3.11'

The same applies to loading the extension in your conf.py:

extensions = [
    # your extensions
    ...
]
if sys.version_info >= (3, 11):
    extensions += ['sphinxcontrib.autodoc_inherit_overload']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file sphinxcontrib.autodoc_inherit_overload-2023.4.tar.gz.

File metadata

File hashes

Hashes for sphinxcontrib.autodoc_inherit_overload-2023.4.tar.gz
Algorithm Hash digest
SHA256 fb6a0d7d4380b14f07b6bd7ffdac61b4e0522499d70522f3bfbc670917615d22
MD5 9328d8c25139a8722a84549d824f945c
BLAKE2b-256 885c7463f42c7249bea1590105f5965b26d5d6a1c06c6bd580b1c0ac41203705

See more details on using hashes here.

File details

Details for the file sphinxcontrib.autodoc_inherit_overload-2023.4-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib.autodoc_inherit_overload-2023.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5ac164aec1c4df941a279282e5ecebe286d91e0b35637a0faa23e25245efd0df
MD5 2183c40fede6e0e2b39af2e67b507cae
BLAKE2b-256 dc8a639b4889c4d97c81697c9eead56adc51b1d91a4c81238f87c191c0fa7f51

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page