class documentation

class CollapseLongUnions(visitors.Visitor): (source)

View In Hierarchy

Shortens long unions to object (or "?"). Poor man's version of FindCommonSuperClasses. Shorten types like "str or unicode or int or float or list" to just "object" or "?". Additionally, if the union already contains at least one "object", we also potentially replace the entire union with just "object". Attributes: max_length: The maximum number of types to allow in a union. If there are more types than this, it is shortened.

Method __init__ Undocumented
Method VisitUnionType Undocumented
Instance Variable generic_type Undocumented
Instance Variable max_length Undocumented

Inherited from Visitor:

Method Enter Undocumented
Method Leave Undocumented
Method Visit Undocumented
Class Variable old_node Undocumented
Class Variable unchecked_node_names Undocumented
Class Variable visits_all_node_types Undocumented
Instance Variable enter_functions Undocumented
Instance Variable leave_functions Undocumented
Instance Variable visit_class_names Undocumented
Instance Variable visit_functions Undocumented
Class Variable _visitor_functions_cache Undocumented
def __init__(self, max_length: int = 7): (source)
def VisitUnionType(self, union): (source)

Undocumented

generic_type = (source)

Undocumented

max_length = (source)

Undocumented