class documentation

Visitor for calling pytd.ToType(). pytd.ToType() usually rejects constants and functions, as they cannot be converted to types. However, aliases can point to them, and typing.Literal can be parameterized by constants, so this visitor tracks whether we are inside an alias or literal, and its to_type() method calls pytd.ToType() with the appropriate allow_constants and allow_functions values.

Method __init__ Undocumented
Method EnterAlias Undocumented
Method EnterLiteral Undocumented
Method LeaveAlias Undocumented
Method LeaveLiteral Undocumented
Method to_type Undocumented
Instance Variable allow_functions Undocumented
Instance Variable allow_singletons Undocumented
Instance Variable _in_alias Undocumented
Instance Variable _in_literal 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 EnterAlias(self, _): (source)

Undocumented

def EnterLiteral(self, _): (source)

Undocumented

def LeaveAlias(self, _): (source)

Undocumented

def LeaveLiteral(self, _): (source)

Undocumented

def to_type(self, t): (source)

Undocumented

allow_functions: bool = (source)

Undocumented

allow_singletons = (source)

Undocumented

_in_alias: bool = (source)

Undocumented

_in_literal: int = (source)

Undocumented