Docs: import datetime as dt in examples#145315
Conversation
068dc30 to
904011a
Compare
There was a problem hiding this comment.
This is churn in my opinion, and quite a lot of it. I agree with Paul 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.
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. |
|
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. |
|
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. 👍 |
|
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.
If the docs experts think it's best, I won't block.
|
Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
(cherry picked from commit d3b6faf) 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 the 3.14 branch. |
(cherry picked from commit d3b6faf) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
|
GH-145584 is a backport of this pull request to the 3.13 branch. |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
See https://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