Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-61648: Detect line numbers of properties in doctests #113161

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Dec 15, 2023

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Two thoughts, both of which are beyond the scope of this PR:

  1. It's a shame doctest doesn't have more generalised support for other kinds of descriptors; functools.cached_property doctests will still not have line numbers, for example. But it is much harder to do without changing doctest's whole approach, I know.
  2. I'm curious if the _find_lineno function correctly handles wrapped functions (e.g. those returned from functools.wraps). Even if it works correctly now, it would be good to add tests for this. But again, it is a separate issue that should be tackled separately.

@serhiy-storchaka serhiy-storchaka merged commit 8f8f0f9 into python:main Dec 15, 2023
34 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@bedevere-app
Copy link

bedevere-app bot commented Dec 15, 2023

GH-113164 is a backport of this pull request to the 3.12 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 15, 2023
…GH-113161)

(cherry picked from commit 8f8f0f9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Dec 15, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 15, 2023
…GH-113161)

(cherry picked from commit 8f8f0f9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Dec 15, 2023

GH-113165 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Dec 15, 2023
@serhiy-storchaka serhiy-storchaka deleted the doctest-property-lineno branch December 15, 2023 13:24
serhiy-storchaka added a commit that referenced this pull request Dec 15, 2023
…3161) (GH-113165)

(cherry picked from commit 8f8f0f9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Dec 15, 2023
…3161) (GH-113164)

(cherry picked from commit 8f8f0f9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
corona10 pushed a commit to corona10/cpython that referenced this pull request Dec 15, 2023
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
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.

2 participants