Strong typing implementation for Python

Terry Reedy tjreedy at udel.edu
Mon Oct 12 16:19:27 EDT 2015


On 10/12/2015 12:08 PM, Michael Torrie wrote:

> Also many Python editing environments do support basic completion.
> However completion is actually very difficult to implement in a static
> manner because Python is so dynamic.  I can import any standard library
> module and rename it as needed.  Since some modules have longer names
> that I don't want to always type and since importing all of a module's
> symbols into the global namespace is really not a good idea, I might do
> something like
>
> import BeautifulSoup as bs
>
> Now I can refer to any BeautifulSoup symbols using the prefix bs.  That
> isn't impossible for an IDE to track, but it is harder.

That depends on whether autocompletion is name or object based.  IDLE's 
is object based, so the following displays the contents of itertools the 
same as without the abbreviation.

 >>> import itertools as it
 >>> it.

Object-based in turn means that autocompletion does not work as well in 
the editor until the code *is* executed.

-- 
Terry Jan Reedy




More information about the Python-list mailing list