This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: automatic imports
Type: enhancement Stage:
Components: None Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: aflag, christian.heimes, juanmabc3, schmir
Priority: normal Keywords:

Created on 2007-05-17 21:36 by juanmabc3, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg55112 - (view) Author: Juan Manuel Borges Caño (juanmabc3) Date: 2007-05-17 21:36
I don't need to declare a variable but I need to declare a module, i.e import module, can this be done automatically?, so time.strftime requires import time automatically in the spirit of the python language, it saves typing and synchronization of the imports with the changes of the source code
msg55113 - (view) Author: Rafael Cunha de Almeida (aflag) Date: 2007-06-28 03:35
I don't think this is a very good idea, if you'll be using the module name all the time, then you might as well simple import it. Besides, I think it could lead to confusion. You may have an object named fo in your script and if you mistakenly type foo a module will get imported and you won't understand anything. Specially if the module is something you don't even know about in your PYTHONPATH.
msg59629 - (view) Author: Ralf Schmitt (schmir) Date: 2008-01-09 21:53
it won't get better than: http://pypi.python.org/pypi/autoimp/
I suggest this should be closed.
msg59648 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-01-10 01:54
The idea is against the basic principals and Zen Of Python (type "import
this at the Python prompt to read more about the Zen Of Python).

Ralf's link about autoimp is a nice solution but don't ever use it in
real code!
msg59658 - (view) Author: Juan Manuel Borges Caño (juanmabc3) Date: 2008-01-10 04:52
Thank you for the link.

I think this bug is already closed.
History
Date User Action Args
2022-04-11 14:56:24adminsetgithub: 44967
2008-01-10 04:52:18juanmabc3setmessages: + msg59658
2008-01-10 01:54:40christian.heimessetstatus: open -> closed
resolution: wont fix
messages: + msg59648
nosy: + christian.heimes
2008-01-09 21:53:28schmirsetnosy: + schmir
messages: + msg59629
2007-05-17 21:36:05juanmabc3create