[Python-Dev] Multiple inheritance

Thomas Wouters thomas@xs4all.net
Tue, 8 May 2001 12:14:20 +0200


On Fri, May 04, 2001 at 02:57:09PM -0400, Barry A. Warsaw wrote:

> >>>>> "JE" == Jeff Epler <jepler@inetnebr.com> writes:

>     | Why not let us spell this as:
>     | 	class X(Y):
>     | 		from Y import foo as _sfoo, bar as _sbar
>     | 		...

>     NS> This already has a meaning in Python.  Paul's suggested syntax
>     NS> is pretty neat, IMHO.

> Not if Y is a class though, right?  That would currently raise an
> ImportError, ...

Nope:

>>> class string:
...     pass
... 
>>> from string import split
>>> string
<class __main__.string at 8072e90>
>>> 

That could be considered a misfeature for more than one reason (like
importing from non-module objects, which you now do by inserting the object
into sys.modules) but can't be fixed without breaking backward
compatibility, except by inventing new syntax.

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!