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.jt...@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@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor