On Fri, 8 Apr 2022 at 10:27, Malthe <mbo...@gmail.com> wrote: > > On Fri, 8 Apr 2022 at 08:51, Paul Moore <p.f.mo...@gmail.com> wrote: > > Are you exaggerating for effect here or would this *actually* just expand to > > > > from datetime import datetime > > default_args = { > > "start_date": datetime(...) > > } > > Yes – and of course that is just a snippet, an actual complete script > will have lots of such imports. > > The point is that in a scripting situation (especially one in which > you have many small scripts) the > top-level import requirement for simple imports like `datetime` > becomes rather verbose.
But Python's origin is in scripting situations, and explicit imports for scripts has always been both the normal approach, and one of Python's *strengths* ("Explicit is better than implicit"). Arguing that explicit imports are a bad thing in (general) scripts is arguing against decades of history and experience. If there's a reason why *your specific context* would benefit from an abbreviated form, you need to present it. But arguing that explicit imports are too verbose for all cases of scripting isn't going to fly, frankly. Paul _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/TMJ4ZI7J62C64PZXQU3WRLFA6FAKPRVB/ Code of Conduct: http://python.org/psf/codeofconduct/