Easily editing base class variables from inherited class
Question: ### How does communication between base classes and inherited classes work?

I have a data class in my python code ( storing all important values, duh ), I
tried inheriting new subclasses from the _data base class_ , everything worked
fine except the fact that the classes were not actually communicating ( when
one class variable was changed in a subclass, the class attribute **was not**
changed in the base class nor any other subclasses.

I guess I just failed to understand how inheritance works, **my question is**
: Does inheritance keep any connection to the base classes, or are the values
set at the time of inheritance?

If there is any connection, how do you easily manipulate base class variables
from a subclass ( I tried it with the _cls_ variable to access base class
variables, didn't work out )

### Example

    
    
    class Base:
        x = 'baseclass var' # The value I want to edit
    
    class Subclass(Base):
        @classmethod(cls)
            ???edit_base_x_var_here??? # This is the part I don't know
    


Answer: Well, you could do that in this way:

    
    
    class Base:
        x = 'baseclass var' # The value I want to edit
    
    class Subclass(Base):
        @classmethod
        def change_base_x(cls):
            Base.x = 'nothing'
    
    
    print Subclass.x
    Subclass.change_base_x()
    print Subclass.x
    

furthermore, you don't have to use `@classmethod`, it could be staticmethod,
because you don't need current class object `cls`:

    
    
    class Base:
        x = 'baseclass var' # The value I want to edit
    
    class Subclass(Base):
        @staticmethod
        def change_base_x():
            Base.x = 'nothing'
    

EDITED:

According to your question, about other way. Yes it is, but not so pretty. I
would say more. If you want to change variable of base class, then you will do
it globally though, so that option with assigning to `Base.x` is the best way
you can achieve that.

