Skip to content

Instantly share code, notes, and snippets.

@agrif
Created December 21, 2013 15:12
Show Gist options
  • Select an option

  • Save agrif/8070614 to your computer and use it in GitHub Desktop.

Select an option

Save agrif/8070614 to your computer and use it in GitHub Desktop.
class Base:
pass
if __name__ == '__main__':
from mod2 import Derived
print("Derived:", Derived)
print("Derived.__bases__:", Derived.__bases__)
print("Base:", Base)
print("issubclass(Derived, Base):", issubclass(Derived, Base))
from mod1 import Base
class Derived(Base):
pass
agrif@nara ~/devel/other/hesperus-realistic/bug $ python -m mod1
Derived: <class 'mod2.Derived'>
Derived.__bases__: (<class 'mod1.Base'>,)
Base: <class '__main__.Base'>
issubclass(Derived, Base): False
agrif@nara ~/devel/other/hesperus-realistic/bug $ python --version
Python 3.3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment