(self, definitions)
Ensures that every element of 'definitions' is a valid macro
        definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
        nothing if all definitions are OK, raise TypeError otherwise.
Ensures that every element of 'definitions' is a valid macro
        definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
        nothing if all definitions are OK, raise TypeError otherwise.
Ensures that every element of definitions is a valid macro definition ie . either ( name value ) 2 - tuple or a ( name ) tuple . Do nothing if all definitions are OK raise TypeError otherwise .
def _check_macro_definitions(self, definitions):
        """Ensures that every element of 'definitions' is a valid macro
        definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
        nothing if all definitions are OK, raise TypeError otherwise.
        """
        for defn in definitions:
            if not (isinstance(defn, tuple) and
                    (len(defn) in (1, 2) and
                      (isinstance (defn[1], str) or defn[1] is None)) and
                    isinstance (defn[0], str)):
                raise TypeError(("invalid macro definition '%s': " % defn) + \
                      "must be tuple (string,), (string, string), or " + \
                      "(string, None)")
def _check_macro_definitions ( self , definitions ) : for defn in definitions : if not ( isinstance ( defn , tuple ) and ( len ( defn ) in ( 1 , 2 ) and ( isinstance ( defn [ 1 ] , str ) or defn [ 1 ] is None ) ) and isinstance ( defn [ 0 ] , str ) ) : raise TypeError ( ( "invalid macro definition '%s': " % defn ) + "must be tuple (string,), (string, string), or " + "(string, None)" )