Issue 1720992: automatic imports - Python tracker (original) (raw)

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:24 admin set github: 44967
2008-01-10 04:52:18 juanmabc3 set messages: +
2008-01-10 01:54:40 christian.heimes set status: open -> closedresolution: wont fixmessages: + nosy: + christian.heimes
2008-01-09 21:53:28 schmir set nosy: + schmirmessages: +
2007-05-17 21:36:05 juanmabc3 create