Q:

Multiple Inheritance Quirk, or Bug in Python?

I am writing a class which should subclass, amongst other classes, code.InteractiveInterpreter. For some reason, one of the methods that that class normally has (compile) is not available on its subclasses when you use multiple inheritance.
Single inheritance works fine:
>>> from code import InteractiveInterpreter
>>> class Single(InteractiveInterpreter): pass
...
>>> hasattr(Single(), 'compile')
True

Multiple inheritance does not:
>>> class Double(object, InteractiveInterpreter): pass
...
>>> hasattr(Double(), 'compile')
False

Flipped the order around though, it works:
>>> class Flipped(InteractiveInterpreter, object): pass
...
>>> hasattr(Flipped(), 'compile')
True

Is there some subtle detail of multiple inheritance that I'm unaware of that is preventing compile from being inherited in some cases, or is there a bug in Python causing this (given the name of the method in question is also the name of a built-in function, I feel like this might be possible.)
I'm trying to reproduce the issue with a class other than InteractiveInterpreter but am unable to... this works fine:
>>> class Original():
...     def compile(self): pass
...
>>> class Secondary(object, Original): pass
...
>>> hasattr(Secondary(), 'compile')
True

I'm using Python 2.7.11, 32 bit, on Windows 10.

A:

Are you sure Flipped produced the given results?
I get the following with a similar setup,
>>> from code import InteractiveInterpreter
>>> class Flipped(InteractiveInterpreter, object): pass
... 
>>> hasattr(Flipped(), 'compile')
True

Based on the source of the module, compile is not a method of the class but an instance attribute created on object initialization. It would make sense that inheriting from object first would not provide the attribute because it's __init__ is defined and the subclass doesn't call InteractiveInterpreter.__init__ to assign the attribute.

