minor python 2.2 wart?

Neal Norwitz neal at metaslash.com
Fri Aug 9 15:42:35 EDT 2002


On Fri, 09 Aug 2002 15:12:53 -0400, Brian Kelley wrote:

> The following code snippet compiles when it probably shouldn't:
> 
> import StringIO
> 
> class Foo(StringIO):
>      pass
> 
> f = Foo()
> 
> Note that it doesn't run :)
> 
> Should the compiler be smart enough to know a module from a class?
> Deriving a class from a builtin function doesn't compile:
> 
> class Foo(map):
>       pass
> 
> For my own edification, is there any reason why this should happen or
> should I send it to the bug tracker?

This was a bug and has been fixed for 2.3.

http://python.org/sf/563060

Apparently, it was not fixed for 2.2 
because of backwards compatibility concerns.

Neal



More information about the Python-list mailing list