[Tutor] Random Number Question

Chris Fuller cfuller084 at thinkingplanet.net
Thu Nov 25 13:27:56 CET 2010


Well, you can try "import x", but your problem wasn't that you used the same 
filename as some Python script on your path, the problem was you then tried to 
import that other script.  So to avoid infinite recursion, all you have to do 
is avoid importing your own filename, which should be easy enough to do 
(assuming there aren't any indirect loops, of course.. but admitting that 
possibility is the price you pay for having the advantages of a dynamic 
language)

On Thursday 25 November 2010, Mac Ryan wrote:
> On Thu, 25 Nov 2010 00:58:23 +0000
> 
> Adam Bark <adam.jtm30 at gmail.com> wrote:
> > Ah yes always avoid giving your modules names that appear in the
> > standard library. It goes wrong, sometimes in unexpected ways.
> 
> I was wondering... apart from checking each name individually, is there
> any easy-peasy way to get a list of names used in the standard library
> (I am thinking to something like "dir(....)"?
> 
> Mac.
> _______________________________________________
> 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