(self, inlist)
Just like Vector's init, you shouldn't call this unless creating a
        zero dyadic.

        zd = Dyadic(0)

        Stores a Dyadic as a list of lists; the inner list has the measure
        number and the two unit vectors; the outerlist holds each unique
        unit vector pair.
Just like Vector's init, you shouldn't call this unless creating a
        zero dyadic.
Just like Vector s init you shouldn t call this unless creating a zero dyadic .
def __init__(self, inlist):
        """
        Just like Vector's init, you shouldn't call this unless creating a
        zero dyadic.

        zd = Dyadic(0)

        Stores a Dyadic as a list of lists; the inner list has the measure
        number and the two unit vectors; the outerlist holds each unique
        unit vector pair.

        """

        self.args = []
        if inlist == 0:
            inlist = []
        while len(inlist) != 0:
            added = 0
            for i, v in enumerate(self.args):
                if ((str(inlist[0][1]) == str(self.args[i][1])) and
                        (str(inlist[0][2]) == str(self.args[i][2]))):
                    self.args[i] = (self.args[i][0] + inlist[0][0],
                                    inlist[0][1], inlist[0][2])
                    inlist.remove(inlist[0])
                    added = 1
                    break
            if added != 1:
                self.args.append(inlist[0])
                inlist.remove(inlist[0])
        i = 0
        # This code is to remove empty parts from the list
        while i < len(self.args):
            if ((self.args[i][0] == 0) | (self.args[i][1] == 0) |
                    (self.args[i][2] == 0)):
                self.args.remove(self.args[i])
                i -= 1
            i += 1
def __init__ ( self , inlist ) : self . args = [ ] if inlist == 0 : inlist = [ ] while len ( inlist ) != 0 : added = 0 for i , v in enumerate ( self . args ) : if ( ( str ( inlist [ 0 ] [ 1 ] ) == str ( self . args [ i ] [ 1 ] ) ) and ( str ( inlist [ 0 ] [ 2 ] ) == str ( self . args [ i ] [ 2 ] ) ) ) : self . args [ i ] = ( self . args [ i ] [ 0 ] + inlist [ 0 ] [ 0 ] , inlist [ 0 ] [ 1 ] , inlist [ 0 ] [ 2 ] ) inlist . remove ( inlist [ 0 ] ) added = 1 break if added != 1 : self . args . append ( inlist [ 0 ] ) inlist . remove ( inlist [ 0 ] ) i = 0 # This code is to remove empty parts from the list while i < len ( self . args ) : if ( ( self . args [ i ] [ 0 ] == 0 ) | ( self . args [ i ] [ 1 ] == 0 ) | ( self . args [ i ] [ 2 ] == 0 ) ) : self . args . remove ( self . args [ i ] ) i -= 1 i += 1