Re: import mysteries

2007-07-05 Thread Peter Otten
David Abrahams wrote: > > on Wed Jul 04 2007, Peter Otten <__peter__-AT-web.de> wrote: > Explicitly passed, see >> http://genshi.edgewall.org/browser/trunk/genshi/filters/tests/transform.py >>> >>> IIRC I ran doctest on the file I cited, not the one you're pointing >>> at. Is th

Re: import mysteries

2007-07-04 Thread David Abrahams
on Wed Jul 04 2007, Peter Otten <__peter__-AT-web.de> wrote: >>> Explicitly passed, see >>> >>> > http://genshi.edgewall.org/browser/trunk/genshi/filters/tests/transform.py >> >> IIRC I ran doctest on the file I cited, not the one you're pointing >> at. Is there some new magic doctest feature I

Re: import mysteries

2007-07-03 Thread Peter Otten
David Abrahams wrote: > > on Thu Jun 21 2007, Peter Otten <__peter__-AT-web.de> wrote: > >> David Abrahams wrote: >> >>> I'm pretty comfortable with Python, but recently I'm constantly >>> finding mysterious issues with import. For example, looking at >>> >>> http://genshi.edgewall.org/brows

Re: import mysteries

2007-07-03 Thread Martin v. Löwis
> Yeah, of course. I just don't think anything that perverse is > happening in these cases. Take, for another example, > http://trac.edgewall.org/ticket/5646#comment:3 [that perverse == putting a name into globals()] When you do gettext.install(...), it will put the name _ into the __builtins__

Re: import mysteries

2007-07-03 Thread David Abrahams
on Thu Jun 21 2007, Peter Otten <__peter__-AT-web.de> wrote: > David Abrahams wrote: > >> I'm pretty comfortable with Python, but recently I'm constantly >> finding mysterious issues with import. For example, looking at >> >> http://genshi.edgewall.org/browser/trunk/genshi/filters/transform.p

Re: import mysteries

2007-07-03 Thread David Abrahams
on Thu Jun 21 2007, Ben Finney wrote: > David Abrahams <[EMAIL PROTECTED]> writes: > >> I'm pretty comfortable with Python, but recently I'm constantly >> finding mysterious issues with import. For example, looking at >> >> http://genshi.edgewall.org/browser/trunk/genshi/filters/transform.py

Re: import mysteries

2007-07-03 Thread David Abrahams
on Fri Jun 22 2007, "Steven D'Aprano" wrote: > There are ways to bypass the import system. The most obvious would be to > write directly to globals. > spanish_inquisition > Traceback (most recent call last): > File "", line 1, in ? > NameError: name 'spanish_inquisition' is not defined

Re: import mysteries

2007-06-21 Thread Steven D'Aprano
On Thu, 21 Jun 2007 16:03:42 -0400, David Abrahams wrote: > I'm pretty comfortable with Python, but recently I'm constantly finding > mysterious issues with import. For example, looking at > > http://genshi.edgewall.org/browser/trunk/genshi/filters/transform.py > > the examples use the symbol

Re: import mysteries

2007-06-21 Thread Ben Finney
David Abrahams <[EMAIL PROTECTED]> writes: > I'm pretty comfortable with Python, but recently I'm constantly > finding mysterious issues with import. For example, looking at > > http://genshi.edgewall.org/browser/trunk/genshi/filters/transform.py > > the examples use the symbol 'HTML' but it's

Re: import mysteries

2007-06-21 Thread Gabriel Genellina
En Thu, 21 Jun 2007 17:03:42 -0300, David Abrahams <[EMAIL PROTECTED]> escribió: > Another example: I was recently working on some code that did an > import from inside a class method. That import was failing. I moved > the import to the top of the file (at module scope) and it succeeded. > I'

Re: import mysteries

2007-06-21 Thread Peter Otten
David Abrahams wrote: > I'm pretty comfortable with Python, but recently I'm constantly > finding mysterious issues with import. For example, looking at > > http://genshi.edgewall.org/browser/trunk/genshi/filters/transform.py > > the examples use the symbol 'HTML' but it's not defined locally

Re: import mysteries

2007-06-21 Thread Martin v. Löwis
David Abrahams schrieb: > I'm pretty comfortable with Python, but recently I'm constantly > finding mysterious issues with import. For example, looking at > > http://genshi.edgewall.org/browser/trunk/genshi/filters/transform.py > > the examples use the symbol 'HTML' but it's not defined local