GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Docs: replace all `datetime` imports with `import datetime as dt` by hugovk · Pull Request #145640 · python/cpython

Conversation

@hugovk

@hugovk hugovk commented Mar 8, 2026 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Follow on from #145315.

Whilst here, also updated some to use sentence case for headers:
https://devguide.python.org/documentation/style-guide/#capitalization


📚 Documentation preview 📚: https://cpython-previews--145640.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
hugovk added 3 commits March 8, 2026 19:53
@hugovk
Docs: 'import datetime as dt' in examples
0427f74
@hugovk
Replace deprecated utcfromtimestamp
0d555e4
@hugovk
Use sentence case for headers
854516b
@hugovk
hugovk requested review from 1st1, AA-Turner, StanFromIreland, asvetlov, berkerpeksag, erlend-aasland, ethanfurman, gpshead, kumaraditya303, pganssle, picnixz, vsajip and willingc as code owners March 8, 2026 18:08
@bedevere-app bedevere-app Bot added the awaiting core review label Mar 8, 2026
@hugovk hugovk mentioned this pull request Mar 8, 2026
Docs: import datetime as dt in examples #145315
Merged
@hugovk hugovk added skip issue skip news needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Mar 8, 2026
StanFromIreland
StanFromIreland reviewed Mar 8, 2026
View reviewed changes
Comment thread Doc/faq/programming.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Mar 8, 2026

Copy link
Copy Markdown
Member

Can we have a better title for this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

StanFromIreland commented Mar 8, 2026

Copy link
Copy Markdown
Member

I suggest:

Docs: replace all datetime imports with import datetime as dt

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303
kumaraditya303 removed their request for review March 9, 2026 11:25
@hugovk
Merge branch 'main' into 3.15-docs-import-datetime-as-dt
fc32d72
@hugovk hugovk changed the title Docs: import datetime as dt in other examples Docs: replace all datetime imports with import datetime as dt Mar 9, 2026
@hugovk
Fix regression
c5aa74d
@hugovk hugovk mentioned this pull request Mar 9, 2026
gh-145704: Fix typo in Doc/faq/programming.rst #145705
Closed
@picnixz picnixz mentioned this pull request Mar 9, 2026
Typo in Doc/faq/programming.rst #145704
Closed
@hugovk
Docs: 'import datetime as dt' in examples
12203d9
StanFromIreland
StanFromIreland approved these changes Mar 9, 2026
View reviewed changes

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

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.

LGTM (with a little fix)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/whatsnew/3.8.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
fixup! Docs: 'import datetime as dt' in examples
93b9b03
@hugovk
hugovk merged commit 83360b5 into python:main Mar 21, 2026
50 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
hugovk deleted the 3.15-docs-import-datetime-as-dt branch March 21, 2026 16:02
@miss-islington-app

miss-islington-app Bot commented Mar 21, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Mar 21, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 21, 2026
@hugovk @miss-islington
Docs: replace all datetime imports with import datetime as dt (py…
a1b0dec
…thonGH-145640)

(cherry picked from commit 83360b5)

Co-authored-by: Hugo van Kemenade <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 21, 2026
@hugovk @miss-islington
Docs: replace all datetime imports with import datetime as dt (py…
c3b5b61
…thonGH-145640)

(cherry picked from commit 83360b5)

Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-app

bedevere-app Bot commented Mar 21, 2026

Copy link
Copy Markdown

GH-146258 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Mar 21, 2026
@bedevere-app

bedevere-app Bot commented Mar 21, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Mar 21, 2026
hugovk added a commit that referenced this pull request Mar 21, 2026
@miss-islington @hugovk
[3.14] Docs: replace all datetime imports with `import datetime as …
d65e8d9
…dt` (GH-145640) (#146258)

Docs: replace all `datetime` imports with `import datetime as dt` (GH-145640)
(cherry picked from commit 83360b5)

Co-authored-by: Hugo van Kemenade <[email protected]>
hugovk added a commit that referenced this pull request Mar 21, 2026
@miss-islington @hugovk
[3.13] Docs: replace all datetime imports with `import datetime as …
5d71935
…dt` (GH-145640) (#146259)

Docs: replace all `datetime` imports with `import datetime as dt` (GH-145640)
(cherry picked from commit 83360b5)

Co-authored-by: Hugo van Kemenade <[email protected]>
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request Mar 22, 2026
@CuriousLearner
Merge remote-tracking branch 'upstream/main' into fix-pythongh-138577
2691ad9
* upstream/main: (1475 commits)
  Docs: replace all `datetime` imports with `import datetime as dt` (python#145640)
  pythongh-146153: Use `frozendict` in pure python fallback for `curses.has_key` (python#146154)
  pythongh-138234: clarify returncode behavior for subprocesses created with `shell=True` (python#138536)
  pythongh-140947: fix contextvars handling for server tasks in asyncio  (python#141158)
  pythonGH-100108: Add async generators best practices section (python#141885)
  pythonGH-145667: Merge `GET_ITER` and `GET_YIELD_FROM_ITER` (pythonGH-146120)
  pythongh-146228: Better fork support in cached FastPath (python#146231)
  pythongh-146227: Fix wrong type in _Py_atomic_load_uint16 in pyatomic_std.h (pythongh-146229)
  pythongh-145980: Fix copy/paste mistake in binascii.c (python#146230)
  pythongh-146092: Raise MemoryError on allocation failure in _zoneinfo (python#146165)
  pythongh-91279: Note `SOURCE_DATE_EPOCH` support in `ZipFile.writestr()` doc (python#139396)
  pythongh-146196: Fix Undefined Behavior in _PyUnicodeWriter_WriteASCIIString() (python#146201)
  pythongh-143930: Reject leading dashes in webbrowser URLs
  pythongh-145916: Soft-deprecate ctypes.util.find_library (pythonGH-145919)
  pythongh-146205: Check the errno with != 0 in close impls in select module (python#146206)
  pythongh-146171: Fix nested AttributeError suggestions (python#146188)
  pythongh-146099: Optimize _GUARD_CODE_VERSION+IP via function version symbols (pythonGH-146101)
  pythongh-145980: Add support for alternative alphabets in the binascii module (pythonGH-145981)
  pythongh-145754: Update signature retrieval in unittest.mock to use forwardref annotation format (python#145756)
  pythongh-145177: Add emscripten run --test, uses test args from config.toml (python#146160)
  ...
@pablogsal pablogsal mentioned this pull request Apr 4, 2026
gh-130273: Fix traceback color output with unicode characters #142529
Merged
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@hugovk @ljfp
Docs: replace all datetime imports with import datetime as dt (py…
b8fa019
…thon#145640)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@StanFromIreland StanFromIreland StanFromIreland approved these changes
@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@vsajip vsajip Awaiting requested review from vsajip vsajip is a code owner
@ethanfurman ethanfurman Awaiting requested review from ethanfurman ethanfurman is a code owner
@pganssle pganssle Awaiting requested review from pganssle pganssle is a code owner
@gpshead gpshead Awaiting requested review from gpshead gpshead is a code owner
@picnixz picnixz Awaiting requested review from picnixz picnixz is a code owner
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner
@willingc willingc Awaiting requested review from willingc willingc is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip issue skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@hugovk @picnixz @StanFromIreland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.