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
#12063 Deprecation helper function docstring handling consistent with Python 3.13 #12064
base: trunk
Are you sure you want to change the base?
Conversation
I am sending this for review as an initial feedback. Not sure if for 3.13 we should handle the docstring stripped, while for older Python version keep the non-strip version. I went with always strip for "future" compatibility. needs-review |
@@ -0,0 +1,2 @@ | |||
twisted.python.deprecate helper function will now always strip the docstrings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "strip whitespace from the docstrings".
spaces = "" | ||
if not trailer.strip(): | ||
# On Python 3.13 the docstring is already stripped. | ||
# For older Python version we keep the trailer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this sentence is quite accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also not sure what was going in there :(
This was done 2 months ago, and now I no longer remember what was the issue here.
I will try to review and update the docstring
@adiroiban Same as other PR; minor changes but you can feel free to merge. |
Many thanks for the review. Happy to see that Twisted on 3.13 gets some attention :) Python 3.13.0 beta 1 is scheduled for 2024-05-07 with final release 3.13.0 2024-10-01 So we should have enough time to prepare Twisted for 3.13 |
Scope and purpose
Fixes #12063
In Python 3.13 the docstrings are stripped.
This causes some errors for our deprecation helpers.
Update the code to have the same behaviour to always strip and handle like Python 3.13.
From 3.13 release notes