Re: PEP 328, absolute/relative import (was: Re: Bizarre error from help())

2005-08-10 Thread Aahz
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: > >So, under PEP 328 rules, the original poster's current-directory >module could only be imported (a) if the current directory was in >sys.path, or (b) if the code specified a relative import. The >accidental shadowing of the s

Re: PEP 328, absolute/relative import (was: Re: Bizarre error from help())

2005-08-10 Thread Roy Smith
Ben Finney <[EMAIL PROTECTED]> wrote: > Once PEP 328 is fully implemented, all bare 'import foo' statements > specify absolute imports (i.e. from sys.path only). To perform a > relative import (e.g. from current directory) will require different > syntax. It seems like this will break lots of exis

PEP 328, absolute/relative import (was: Re: Bizarre error from help())

2005-08-10 Thread Ben Finney
Peter Hansen <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > Roy Smith <[EMAIL PROTECTED]> wrote: > >>[current-directory module shadowing a system module] > > > > All hail the coming of PEP 328: > > http://www.python.org/peps/pep-0328.html> > > Which, unless I misunderstand, would do nothi

Re: Bizarre error from help()

2005-08-10 Thread Peter Hansen
Ben Finney wrote: > Roy Smith <[EMAIL PROTECTED]> wrote: > >>I've got a directory where I keep all sorts of little snippets of >>python code for testing. When I start up python in that directory, >>I get the error I reported. It turns out, I've got a file called >>"string.py" in it [...] >> >>so

Re: Bizarre error from help()

2005-08-09 Thread Ben Finney
Roy Smith <[EMAIL PROTECTED]> wrote: > I've got a directory where I keep all sorts of little snippets of > python code for testing. When I start up python in that directory, > I get the error I reported. It turns out, I've got a file called > "string.py" in it [...] > > something in the help sys

Re: Bizarre error from help()

2005-08-09 Thread Leif K-Brooks
Roy Smith wrote: > No, that works fine. But, now I can't even reproduce the error I reported > earlier (when I try, I get the help message as expected). And, yes, that > was with a brand new interpreter session. Strange. Perhaps you were running Python from a directory with a file called strin

Re: Bizarre error from help()

2005-08-09 Thread Roy Smith
Roy Smith <[EMAIL PROTECTED]> wrote: > No, that works fine. But, now I can't even reproduce the error I reported > earlier (when I try, I get the help message as expected). And, yes, that > was with a brand new interpreter session. Strange. I got it now! Oh, this is funny. I've got a directo

Re: Bizarre error from help()

2005-08-09 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote: > Roy Smith wrote: > > > Traceback (most recent call last): > > File "", line 1, in ? > > File "/usr/local/lib/python2.3/site.py", line 307, in call > > import pydoc > > File "/usr/local/lib/python2

RE: Bizarre error from help()

2005-08-09 Thread Delaney, Timothy (Tim)
Roy Smith wrote: > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.3/site.py", line 307, in __call__ > import pydoc > File "/usr/local/lib/python2.3/pydoc.py", line 49, in ? > from string import expandtabs, find, join, lower, split, strip, >