minor python 2.2 wart?

Brian Kelley bkelley at wi.mit.edu
Fri Aug 9 21:12:53 CEST 2002


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?

Brian Kelley




More information about the Python-list mailing list