Inheriting from a class defined in an imported module in Python -


i have 2 python classes in 2 separate modules. modules reference each other, must use import xxx syntax rather from xxx import yyy. can't figure out how access class defiend in 1 module in other, importing module though:

### testa.py  import testb  class testa():   ...  ### testb.py  import testa  class testb(testa.testa):  # doesn't work   ... 

how do this?

you can solve putting import testb after definition of testa. however, might need rethink module structure since circular imports difficult deal with.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -