def VisitClass(self, cls):
    'Add superclass methods and constants to this Class.'
    if any((base for base in cls.parents if isinstance(base, pytd.NamedType))):
        raise AssertionError('AddInheritedMethods needs a resolved AST')
    bases = [base.cls for base in cls.parents if isinstance(base, pytd.ClassType)]
    names = ({m.name for m in cls.methods} | {c.name for c in cls.constants})
    adjust_self = visitors.AdjustSelf(force=True)
    adjust_self.class_types.append(visitors.ClassAsType(cls))
    new_methods = list(cls.methods)
    for base in bases:
        for m in base.methods:
            if (m.name not in names):
                new_methods.append(m.Visit(adjust_self))
    new_constants = list(cls.constants)
    for base in bases:
        for c in base.constants:
            if (c.name not in names):
                new_constants.append(c)
    return cls.Replace(methods=tuple(new_methods), constants=tuple(new_constants))
Add superclass methods and constants to this Class.
def VisitClass(self, cls):
    
    if any((base for base in cls.parents if isinstance(base, pytd.NamedType))):
        raise AssertionError('AddInheritedMethods needs a resolved AST')
    bases = [base.cls for base in cls.parents if isinstance(base, pytd.ClassType)]
    names = ({m.name for m in cls.methods} | {c.name for c in cls.constants})
    adjust_self = visitors.AdjustSelf(force=True)
    adjust_self.class_types.append(visitors.ClassAsType(cls))
    new_methods = list(cls.methods)
    for base in bases:
        for m in base.methods:
            if (m.name not in names):
                new_methods.append(m.Visit(adjust_self))
    new_constants = list(cls.constants)
    for base in bases:
        for c in base.constants:
            if (c.name not in names):
                new_constants.append(c)
    return cls.Replace(methods=tuple(new_methods), constants=tuple(new_constants))