[Python-Dev] Generalized "from M. import X" was RE: Python 2.1 alpha 2 released)
Moshe Zadka
moshez@zadka.site.co.il
Sat, 3 Feb 2001 09:12:44 +0200 (IST)
On Sat, 3 Feb 2001 01:53:53 -0500, "Tim Peters" <tim.one@home.com> wrote:
> >>> alist = []
> >>> hasattr(alist, "sort")
> 1
> >>> from alist import sort
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ImportError: No module named alist
> >>>
Tim, don't you remember to c.l.py discussions?
>>> class Foo:
... pass
...
>>> foo=Foo()
>>> foo.foo = 'foo'
>>> import sys
>>> sys.modules['foo'] = foo
>>> import foo
>>> print foo.foo
foo
>>> from foo import foo
>>> print foo
foo
>>>
--
Moshe Zadka <sig@zadka.site.co.il>
This is a signature anti-virus.
Please stop the spread of signature viruses!
Fingerprint: 4BD1 7705 EEC0 260A 7F21 4817 C7FC A636 46D0 1BD6