Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.2k
Docs:import datetime as dt in examples#145315
Conversation
068dc30 to904011aCompare
StanFromIreland left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
This is churn in my opinion, and quite a lot of it. I agree withPaul Moore's comment, we need not enforce such things. I also don't see consensus in the thread for this, from a rough count I gather more people are against the change.
Uh oh!
There was an error while loading.Please reload this page.
hugovk commentedMar 1, 2026
There's no enforcement here, this is a docs-only change. You can still
I disagree. I see more people against code and linter changes, but maybe just a couple against docs changes. I see 12 supporting Terry's docs suggestion (plus him), and another couple also supporting via comments. |
nedbat commentedMar 3, 2026
I'm in favor of changing these examples in the docs. It provides a clear distinction between the module and the class, while gently showing importing the module as a preference over importing the classes directly. |
Uh oh!
There was an error while loading.Please reload this page.
treyhunner commentedMar 3, 2026
I do struggle with new Python learners hitting confusion about the different between the module and the class I tend to use the I am in favor of changing the documentation so that they do not use the I read through all the changes and they look good to me. 👍 |
picnixz commentedMar 5, 2026
I'm also in favor of this change. Too many times my IDE bite me by importing the class instead of the module or vice-versa so |
StanFromIreland 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.
If the docs experts think it's best, I won't block.
d3b6faf intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
(cherry picked from commitd3b6faf)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Sorry,@hugovk, I could not cleanly backport this to |
GH-145583 is a backport of this pull request to the3.14 branch. |
(cherry picked from commitd3b6faf)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
GH-145584 is a backport of this pull request to the3.13 branch. |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
hugovk commentedMar 8, 2026
Please see PR#145640. |
Uh oh!
There was an error while loading.Please reload this page.
Seehttps://discuss.python.org/t/renaming-datetime-datetime-to-datetime-datetime/26279/4 and the following post for support.
There's a few other examples in other files we can update after this.
📚 Documentation preview 📚:https://cpython-previews--145315.org.readthedocs.build/en/145315/library/datetime.html