def create_from_other( Class, other, values=None ):
        """
        Create a new Matrix with attributes taken from `other` but with the 
        values taken from `values` if provided
        """
        m = Class()
        m.alphabet = other.alphabet
        m.sorted_alphabet = other.sorted_alphabet
        m.char_to_index = other.char_to_index
        if values is not None:
            m.values = values
        else:
            m.values = other.values
        return m
def create_from_other ( Class , other , values = None ) : m = Class ( ) m . alphabet = other . alphabet m . sorted_alphabet = other . sorted_alphabet m . char_to_index = other . char_to_index if values is not None : m . values = values else : m . values = other . values return m
Create a new Matrix with attributes taken from `other` but with the 
        values taken from `values` if provided