@staticmethod<EOL><INDENT>def iter_bases(bases):<DEDENT>
sequences = ([list(inspect.getmro(base)) for base in bases] +<EOL>[list(bases)])<EOL>while True:<EOL><INDENT>sequences = [seq for seq in sequences if seq]<EOL>if not sequences:<EOL><INDENT>return<EOL><DEDENT>for seq in sequences:<EOL><INDENT>head = seq[<NUM_LIT:0>]<EOL>tails = [seq for seq in sequences if head in seq[<NUM_LIT:1>:]]<EOL>if not tails:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>'<STR_LIT:U+002CU+0020>'.join([base.__name__ for base in bases]))<EOL><DEDENT>yield head<EOL>for seq in sequences:<EOL><INDENT>if seq[<NUM_LIT:0>] == head:<EOL><INDENT>del seq[<NUM_LIT:0>]<EOL><DEDENT><DEDENT><DEDENT>
Performs MRO linearization of a set of base classes.  Yields
each base class in turn.