Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
serhiy-storchaka merged 1 commit intopython:3.13python/cpython:3.13from
miss-islington:backport-fece15d-3.13miss-islington/cpython:backport-fece15d-3.13Copy head branch name to clipboard
Aug 10, 2025
Merged

[3.13] gh-136914: Fix support of cached functions and properties in DocTest's lineno computation (GH-136930)#137615
serhiy-storchaka merged 1 commit intopython:3.13python/cpython:3.13from
miss-islington:backport-fece15d-3.13miss-islington/cpython:backport-fece15d-3.13Copy head branch name to clipboard

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Aug 10, 2025

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().
(cherry picked from commit fece15d)

Co-authored-by: Denis Laxalde denis@laxalde.org

…cTest's lineno computation (pythonGH-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().
(cherry picked from commit fece15d)

Co-authored-by: Denis Laxalde <denis@laxalde.org>
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) August 10, 2025 19:44
@serhiy-storchaka serhiy-storchaka merged commit 23b7a95 into python:3.13 Aug 10, 2025
38 of 39 checks passed
@miss-islington miss-islington deleted the backport-fece15d-3.13 branch January 2, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.