import datetime as dt
Python 3.15 datetime docs now officially recommend import datetime as dt in a Tip block, to disambiguate the module from the datetime.datetime class. The tip cites Adam Johnson’s 2019 post — 6 years from community convention to CPython docs. Fixes both traps: from datetime import datetime shadows the module, and import datetime reads ambiguously as datetime.datetime.now(). via