class documentation

class SuperClassHierarchy: (source)

View In Hierarchy

Utility class for optimizations working with superclasses.

Method __init__ Undocumented
Method ExpandSubClasses Generate a set of all (known) subclasses for a type.
Method ExpandSuperClasses Generate a list of all (known) superclasses for a type.
Method GetSuperClasses Undocumented
Method HasSubClassInSet Queries whether a subclass of a type is present in a given set.
Method HasSuperClassInSet Queries whether a superclass of a type is present in a given set.
Method _CollectSuperclasses Recursively collect super classes for a type.
Instance Variable _subclasses Undocumented
Instance Variable _superclasses Undocumented
def __init__(self, superclasses): (source)

Undocumented

def ExpandSubClasses(self, t): (source)

Generate a set of all (known) subclasses for a type. Arguments: t: A type. E.g. NamedType("int"). Returns: A set of types. This set includes t as well as all its subclasses. For example, this will return "int" and "bool" for "int".

def ExpandSuperClasses(self, t): (source)

Generate a list of all (known) superclasses for a type. Arguments: t: A type name. E.g. "int". Returns: A set of types. This set includes t as well as all its superclasses. For example, this will return "bool", "int" and "object" for "bool".

def GetSuperClasses(self): (source)

Undocumented

def HasSubClassInSet(self, cls, known): (source)

Queries whether a subclass of a type is present in a given set.

def HasSuperClassInSet(self, cls, known): (source)

Queries whether a superclass of a type is present in a given set.

def _CollectSuperclasses(self, type_name, collect): (source)

Recursively collect super classes for a type. Arguments: type_name: A string, the type's name. collect: A set() of strings, modified to contain all superclasses.

_subclasses = (source)

Undocumented

_superclasses = (source)

Undocumented