Class inheritance from different modules python
Question: I'm new to python and I have a hard time trying to figuring out how can I
inherit from a class in an other module.

module: ~/foo.py

    
    
    import bar
    
    class foo:
        def test(self)
            print("this is a test")
    

module: ~/bar.py

    
    
    class bar(foo):
        def __init__(self):
            super().test()
    

As soon as bar is imported, I get this error message :

    
    
    NameError: name 'foo' is not defined
    


Answer: [If you want to refer to a name in another module then you must import
it.](https://docs.python.org/3/tutorial/modules.html)

    
    
    import foo
    
    class bar(foo.foo):
       ...
    

