Skip to content

Conversation

gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Apr 8, 2025

@gaogaotiantian
Copy link
Member Author

Hi @sobolevn , I think we've been working on _lsprof a few times so maybe you could take a look at this fix?

@gaogaotiantian gaogaotiantian added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Apr 8, 2025
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks! Mostly looks good :)

self.assertEqual(nc, 1)

def test_bad_descriptor(self):
"""
Copy link
Member

Choose a reason for hiding this comment

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

I know that this is used above, but I am not a fan of docstrings in unittests :( Docstrings can be shown during test execution.

Let's maybe convert it to comments?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't have problem converting it to comments, but it seems to be pretty random if we do it case by case. I think we have plenty of docstrings in our test suite. I always use python -m test for stdlib tests so the docstring never bothers me. Do you use unittest directly for these tests? If we want to even soft-enforce this, we should probably discuss it among some core devs and put it somewhere in the devguide. Most people won't be able to see it, but we can refer to it during code reviews and we can gradually make it happen.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay I converted this to a comment - I don't have a strong opinion on this (it's easier to do a docstring if the description is long so I normally just do a docstring). If you believe this actually matters in some cases, we should probably discuss it and put it to somewhere in devguide. It would be helpful for people like us to make a decision and get use to it :)

…PBFCw.rst

Co-authored-by: sobolevn <mail@sobolevn.me>
@gaogaotiantian gaogaotiantian removed the needs backport to 3.12 only security fixes label Apr 8, 2025
@gaogaotiantian gaogaotiantian merged commit ab64130 into python:main Apr 8, 2025
46 checks passed
@miss-islington-app
Copy link

Thanks @gaogaotiantian for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 8, 2025
…r raises an excep… (pythonGH-132251)

(cherry picked from commit ab64130)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Apr 8, 2025

GH-132281 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Apr 8, 2025
gaogaotiantian added a commit that referenced this pull request Apr 8, 2025
…or raises an excep… (GH-132251) (#132281)

gh-132250: Clear error in lsprof callback when method descriptor raises an excep… (GH-132251)
(cherry picked from commit ab64130)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
@gaogaotiantian gaogaotiantian deleted the clear-lsprof-err branch April 8, 2025 21:19
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
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