[Tutor] Python conundrum

Alan Gauld alan.gauld at btinternet.com
Thu Jul 7 19:18:42 CEST 2011


"Lisi" <lisi.reisz at gmail.com> wrote

> <quote> A shortcut is to do your import like this:
> from ex25 import  * </quote>
>
> Is this a new and wonderful meaning of the word "shortcut"?

No, it just saves you typing ex25. in front of every name in the 
module.

Of course, the "import *" technique is frowned upon because
of the risk of introducing name conflicts, so its not really a
recommended "shortcut"...


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/






_Why_, _how_ is
> that a shortcut for:
>
> import ex25
>
> when it has seven *more* characters (counting the spaces)?  Or, put 
> another
> way, twice as many words? :-/
>
> It is obviously an alternative, but I just don't get that it is a 
> shortcut.
>
> Thanks,
> Lisi
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
> 




More information about the Tutor mailing list