-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-112451: Prohibit subclassing of datetime.timezone. #114190
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
Conversation
f3ec4d1 to
0820caa
Compare
|
This will need a deprecation period as per PEP-387. |
Great, my first deprecation in Python 🎉 WIP |
0820caa to
cd231e6
Compare
cd231e6 to
832d948
Compare
|
Updated 👍 |
I guess it isn't the worst thing in the world to have this deprecation period, but I think for PEP 399 compliance, especially when the feature is available only in the pure-Python module (which is not commonly used), there's a case to be made that this doesn't need a deprecation period. I'm sure I'll eat my words when some PyPy-only user shows up and tells us they have been subclassing |
|
Oh, TIL PEP-399; thanks, Paul. I'm always fascinated on the various ways people depend on very specific behaviour. Thanks for opening an issue over at the SC tracker. |
This is consistent with C-extension datetime.timezone.
832d948 to
7b25e5e
Compare
|
I reverted the deprecation per the Steering Council decision. |
pganssle
left a comment
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.
Looks good to me, thanks for bearing through the uncertainty @felixxm !
Misc/NEWS.d/next/Library/2024-01-24-20-11-46.gh-issue-112451.7YrG4p.rst
Outdated
Show resolved
Hide resolved
|
Yes, thanks @felixxm! And thanks a lot to @pganssle and @serhiy-storchaka for your guidance 🙏 |
|
Thanks y'all for help and reviews 🥇 |
…14190) This is consistent with C-extension datetime.timezone.
…14190) This is consistent with C-extension datetime.timezone.
This is consistent with C-extension
datetime.timezone.datetime.timezoneis not acceptable as a base class; pure-Python version is #112451