import random module

Just just at xs4all.nl
Thu Mar 23 03:09:20 EST 2006


In article <1143079535.649503.127170 at t31g2000cwb.googlegroups.com>,
 "Carl Banks" <invalidemail at aerojockey.com> wrote:

> Ben Finney wrote:
> > "DataSmash" <rdh at new.rr.com> writes:
> > > * random.py:
> > >
> > > import random
> >
> > Now that you've tripped over this ambiguity of Python's current
> > 'import' behaviour, you may be interested to know that the behaviour
> > will change to solve this:
> >
> >     <URL:http://www.python.org/dev/peps/pep-0328/>
> 
> I don't believe this change will solve the problem at hand, at least
> there's nothing in the PEP that says it will.  "import random" is an
> absolute import even in random.py is in the current directory, because
> current directory is in sys.path.  Unless there's a change sys.path
> planned, the shadowing should still happen.

Correct. See also http://python.org/sf/946373 for more explanations and 
also more of the same confusion.

Just



More information about the Python-list mailing list