Commit Graph

5 Commits

Author SHA1 Message Date
Adam Turner
d59084a1fa Bump Ruff to 0.8.6 2025-01-06 06:05:55 +00:00
Adam Turner
00ad109a39 Run Ruff on `tests/roots/` 2025-01-03 01:33:14 +00:00
Adam Turner
f4c8a0a68e Insert `from __future__ import annotations` 2023-01-01 20:48:37 +00:00
Takeshi KOMIYA
d77622ba79 Fix #7807: autodoc: wrong signature is shown for the function using contextmanager 2020-06-14 01:31:18 +09:00
Terence D. Honles
90de551d4c Fix: autodoc: __wrapped__ functions are not documented correctly
Functions that are decorated with `@lru_cache` or other `functools`
decorators may not even be detected as a function. This results in the
documentation not having the `()` or even trying to render the function
signature.

This change updates the `sphinx.util.inspect` code to unwrap
`__wrapped__` functions before determining if they can be documented.

`@lru_cache` and its associated test is an example of a decorated
function that is incorrectly identified as an attribute rather than a
module level function and when rendering the signature (upon changing
`isattributedescriptor`) the decorated function is still incorrectly
identified as a C function.

This change also renames the newly introduced `unwrap` as `unwrap_all`
because it is different than the prexisting Python supplied
`inspect.unwrap`.

See `update_wrapper` "Changed in version 3.4" for more background:
https://docs.python.org/3/library/functools.html#functools.update_wrapper
2020-02-27 16:27:41 -08:00