'Debug helper to print the ABC registry.'

def _dump_registry(cls, file=None):

    print >>file, ('Class:    %s.%s' % (cls.__module__, cls.__name__))
    print >>file, ('Inv.counter:    %s' % ABCMeta._abc_invalidation_counter)
    for name in sorted(cls.__dict__.keys()):
        if name.startswith('_abc_'):
            value = getattr(cls, name)
            print >>file, ('%s:    %r' % (name, value))
