minor python 2.2 wart?

Brian Kelley bkelley at wi.mit.edu
Fri Aug 9 15:12:53 EDT 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