[Python-bugs-list] [ python-Bugs-563060 ] Module can be used as a base class

noreply@sourceforge.net noreply@sourceforge.net
Fri, 31 May 2002 12:41:34 -0700


Bugs item #563060, was opened at 2002-05-31 15:41
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=563060&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Neal Norwitz (nnorwitz)
Assigned to: Nobody/Anonymous (nobody)
Summary: Module can be used as a base class

Initial Comment:
>From python-dev:

> But this is not what I would expect:
> 
>       >>> import string
>       >>> class newstr(string): pass
>       ... 
>       # i would have expected this to raise a TypeError
>       >>> x = newstr()
>       Traceback (most recent call last):
>         File "<stdin>", line 1, in ?
>       TypeError: 'module' object is not callable
> 
> Perhaps this error should be handled when the class
is constructed
> rather than when instantiating an object?

Guido says "the bug is that you can use any module as a
base class"

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=563060&group_id=5470