Proposal: Inline Import

Shane Hathaway shane at hathawaymix.org
Sat Dec 10 01:42:21 CET 2005


Mike Meyer wrote:
> Shane Hathaway <shane at hathawaymix.org> writes:
>>I'd like a way to import modules at the point where I need the
>>functionality, rather than remember to import ahead of time.  This
>>might eliminate a step in my coding process.  Currently, my process is
>>I change code and later scan my changes to make matching changes to
>>the import statements.   The scan step is error prone and time
>>consuming. By importing inline, I'd be able to change code without the
>>extra scan step.
> 
> 
> As others have pointed out, you can fix your process. That your
> process doesn't work well with Python isn't a good reason for changing
> Python.

Do you have any ideas on how to improve the process of maintaining 
imports?  Benji's suggestion of jumping around doesn't work for moving 
code and it interrupts my train of thought.  Sprinkling the code with 
import statements causes a speed penalty and a lot of clutter.

I'm actually quite surprised that others aren't bothered by the process 
of maintaining imports.  Perhaps the group hasn't spent time in Eclipse 
to see what a relief it is to have imports managed for you.  The 
difference isn't enough to make anyone jump ship to Java, but it's a 
real improvement.

Shane



More information about the Python-list mailing list