SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 220 Python

gh-136914: Fix support of cached functions and properties in DocTest's lineno computation (GH-136930)

Previously, DocTest's lineno of functions and methods decorated with
functools.cache(), functools.lru_cache() and functools.cached_property()
was not properly returned (None was returned) because the
computation relied on inspect.isfunction() which does not consider the
decorated result as a function.

We now use the more generic inspect.isroutine(), as elsewhere
in doctest's logic.

Also, added a special case for functools.cached_property().
D
Denis Laxalde committed
fece15d29f28e89f1231afa80508c80ed28dc37d
Parent: d5e75c0
Committed by GitHub <noreply@github.com> on 7/25/2025, 9:46:12 AM