unstale

pypi / sphinx-autodoc-typehints

sphinx-autodoc-typehints

What changed in sphinx-autodoc-typehints 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-22.

2 breaking5 new APIs and options1 performance18 behavior and defaults53 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.3 on npm

sphinx-autodoc-typehints 379 changes

Breaking changes 2

  • Invalid formatter and defaults settings report configuration errors; an empty formatter result hides the type and removes fields it empties.

    3.14.0release notes

  • The setting defaults to autodoc_typehints_format = "fully-qualified"; an explicit value still takes precedence.

    3.14.0release notes

New APIs and options 5

  • Adds a default style that marks parameters callers may omit without printing their default values.

    3.17.0release notes

  • Adds an option to render legacy typing aliases with current Python spelling.

    3.17.0release notes

  • Configure selected Annotated metadata to appear in rendered types.

    3.15.0release notes

  • A @typing.override method gains an Overrides field linking to the base-class member it replaces.

    3.14.0release notes

  • A property gains a Setter accepts field when its setter annotation differs from the getter return type.

    3.14.0release notes

Performance 1

  • The extension avoids importing every module in an intersphinx inventory and stops unwrapping at Sphinx mocks, reducing unnecessary work.

    3.14.0release notes

Behavior and default changes 18

  • Callbacks can read descriptions from Annotated metadata classes other than Doc.

    3.17.0release notes

  • Read Doc descriptions from annotated-doc as well as typing_extensions.

    3.16.0release notes

  • Keep single-word prose in hand-written :Returns: fields.

    3.16.0release notes

  • Choose a guard's branch using the build platform and false constants, and skip guards with other conditions that cannot be determined without running code.

    3.16.0release notes

  • When typehints_formatter_pass_context is enabled, the formatter receives whether a type appears in a parameter, return, attribute or base.

    3.15.0release notes

  • Added parameters appear in signature order among documented parameters, and incremental builds reread sources when the setting changes.

    3.14.0release notes

  • Dataclass and attrs default factories render as calls in signatures and fields; lambdas, partials and nested functions retain <factory>.

    3.14.0release notes

  • Types inherited from generic bases substitute the type arguments bound by the subclass, including parameters, returns, attributes, properties, overloads and TypedDict keys.

    3.14.0release notes

  • ivar, cvar and var fields obtain types from class-body and base-class annotations, with ClassVar and Final qualifiers removed.

    3.14.0release notes

  • Napoleon attribute entries can be typed from __init__ annotations unless disabled; existing :type: documentation takes precedence.

    3.14.0release notes

  • Function, class and type-alias signatures show PEP 695 parameters, including bounds, constraints and defaults; declared parameters render by name.

    3.14.0release notes

  • Documentation follows custom __signature__ values and preserves explicit directive or docstring signatures when their parameters differ from the object.

    3.14.0release notes

  • Documented keyword arguments from Unpack[TypedDict] are typed; optional keys show as NotRequired[...], and PEP 728 classes gain an Extra items field.

    3.14.0release notes

  • Defaults appear on their own parameter when docstrings already contain type lines, and are placed after the final plain description paragraph.

    3.14.0release notes

  • With this setting false, return types are merged into :returns: descriptions, including existing :rtype: fields and multiline descriptions.

    3.14.0release notes

  • Types retained in signatures use the same rendering as fields, including aliases, guarded imports, fully qualified names and the formatter; overloads show one typed signature per variant.

    3.14.0release notes

  • Unpacked TypeVarTuples and tuples render with the PEP 646 star syntax.

    3.14.0release notes

  • Subscripted type aliases are now supported.

    3.13.2release notes

Fixes and other changes 53

  • Overridden methods link to a documented public owner when their defining class is private and absent from the intersphinx inventory.

    3.17.2release notes

  • The setting is now honored when reading types from a function's # type: comment.

    3.16.0release notes

  • Loading the extension no longer changes html_static_path because the value stylesheet is registered through Sphinx's static-directory API.

    3.16.0release notes

  • Recognize numpydoc return types containing spaces.

    3.16.0release notes

  • Method signatures of classes defined inside functions are processed when the module exports the class under a name autodoc can import.

    3.15.0release notes

  • An unchanged incremental build no longer reports html_static_path as changed after the extension adds its stylesheet.

    3.15.0release notes

  • Inherited special methods of a generic subclass are documented without raising an error about subscripting an already-subscripted typing.Generic.

    3.15.0release notes

  • The setter's type is shown instead of failing the build when Annotated metadata raises during comparison with the getter type.

    3.15.0release notes

  • Descriptions in hand-written :Returns: fields are kept rather than interpreted as numpydoc return types.

    3.15.0release notes

  • Imports under if TYPE_CHECKING and False are skipped instead of resolving types the branch never defines.

    3.15.0release notes

  • Incremental builds reread documents when the formatter changes, updating rendered types without requiring sphinx-build -E.

    3.15.0release notes

  • With both, constructor parameters are listed once, including those added by always_document_param_types or Doc().

    3.14.0release notes

  • The extension loads sphinx.ext.autodoc before connecting to its events, avoiding Unknown event name when autodoc is listed later or omitted.

    3.14.0release notes

  • Subscripted and union types from mocked modules render and link correctly; mocked constructors, setters and overloads no longer abort unwrapping.

    3.14.0release notes

  • Documented aliases link to their own entries and resolve according to Python name lookup, including entries read later in the build.

    3.14.0release notes

  • Return types in description mode are placed after the appropriate parameter field list, rather than before later docstring structures.

    3.14.0release notes

  • Unparseable string annotations render as written with a forward_reference warning instead of aborting the build; other annotations remain resolvable when one fails.

    3.14.0release notes

  • Generator return annotations provide a Yields section when the docstring has Returns; yielded types are shown without replacing types already stated in the docstring.

    3.14.0release notes

  • Overload entries link their types, preserve parameter markers, defaults and variadic stars, and omit self and cls where appropriate.

    3.14.0release notes

  • ParamSpec arguments, P.args and P.kwargs render in their appropriate forms and retain links to the declared parameter specification.

    3.14.0release notes

  • Sentinels render by name as py:data references rather than links to a nonexistent sentinel class.

    3.14.0release notes

  • Signatures for cached functions and unbound ParamSpecs are handled correctly, including Python 3.14 annotation and generator cases.

    3.14.0release notes

  • Annotation evaluation failures no longer crash builds or drop objects, and inferred stub or type-comment annotations do not mutate __annotations__.

    3.14.0release notes

  • Stub imports, version-guarded definitions, overloads and re-exports are resolved; pages using a stub are reread when it changes.

    3.14.0release notes

  • Guarded imports and definitions resolve across supported guard forms and module relationships without replacing runtime bindings or changing module members.

    3.14.0release notes

  • Defaults are rendered consistently across docstring parameter forms, with stable representations and placement that avoids trailing lists, directives and literal blocks.

    3.14.0release notes

  • When overload documentation is disabled, the :no-overloads: marker is removed from output.

    3.14.0release notes

  • Setting this option to false hides Annotated[None, ...] as a return type.

    3.14.0release notes

  • The setting no longer causes an unpickleable-configuration warning, and documents are reread only when its function source changes.

    3.14.0release notes

  • The formatter applies consistently to signature types and data, attribute and property headers; Sphinx config is passed when formatting signatures.

    3.14.0release notes

  • The decorator's message appears as a deprecation notice below the summary.

    3.14.0release notes

  • Annotating with the TypeVar or ParamSpec class itself no longer prints its member descriptors.

    3.13.10release notes

  • A bare Literal renders without empty brackets.

    3.13.10release notes

  • Type hints are no longer printed in signatures of NamedTuple classes and classes that only define __new__, matching other classes.

    3.13.10release notes

  • Supported typing names, including ParamSpecArgs and ParamSpecKwargs on Python 3.12, link to the Python docs instead of rendering as unresolved text.

    3.13.10release notes

  • Fixes the forward-reference warning when documenting NumPy's clip by resolving generic parameters declared in stub signatures.

    3.13.9release notes

  • Resolves field types of a NamedTuple imported under TYPE_CHECKING when Sphinx documents the class before any function from its module, removing a forward-reference warning.

    3.13.8release notes

  • Dependencies imported only in TYPE_CHECKING blocks can be mocked when not installed, allowing their types to render as cross-references without a Failed guarded type import warning.

    3.13.7release notes

  • Undocumented type aliases are expanded, while documented aliases keep their names, regardless of documentation order.

    3.13.6release notes

  • Fixes a NameError crash when a PEP 695 alias defined in another module uses names imported under TYPE_CHECKING.

    3.13.5release notes

  • Annotations carrying an intersphinx external+ role no longer trigger an unknown role name warning.

    3.13.4release notes

  • A failing TYPE_CHECKING statement no longer causes comprehension and loop targets to shadow builtins such as type in rendered annotations.

    3.13.4release notes

  • Fixes an ExtensionError about _annotation_globals that occurred when documenting one object started documenting another.

    3.13.3release notes

  • Docstrings referencing another project through an intersphinx external+ role no longer produce an unknown role name warning.

    3.13.3release notes

  • Expressions rejected by the interpreter inside a TYPE_CHECKING block no longer emit guarded type import or forward-reference warnings; their names render as forward references.

    3.13.3release notes

  • Processes each top-level statement separately, preventing an unimportable name from leaving later names unbound or a missing stub from causing cascading forward-reference warnings.

    3.13.1release notes

  • Fixes a TypeError crash when a module imports TypeAliasType whose __type_params__ is not a tuple.

    3.13.1release notes

  • Python 3.15 is now supported.

    3.13.0release notes

  • Resolves self-references in recursive PEP 695 aliases defined in another module, fixing a nitpick warning.

    3.12.1release notes

  • Renders self-referential PEP 695 type aliases instead of aborting with a recursion-depth error.

    3.12.0release notes

  • The one-line summary of overloaded functions appears above the overload list.

    3.11.1release notes

  • On Python 3.13+, types module members use the py:class role to match the Python documentation.

    3.11.1release notes

  • Types of C extension properties and attributes are taken from their .pyi stub.

    3.11.0release notes