class documentation

class TypeVarLikeScope: (source)

View In Hierarchy

Scope that holds bindings for type variables and parameter specifications.

Node fullname -> TypeVarLikeType.

Method __init__ Initializer for TypeVarLikeScope
Method __str__ Undocumented
Method allow​_binding Undocumented
Method bind​_existing Undocumented
Method bind​_new Undocumented
Method class​_frame A new scope frame for binding a class. Prohibits this class's tvars
Method get​_binding Undocumented
Method get​_function​_scope Get the nearest parent that's a function scope, not a class scope
Method method​_frame A new scope frame for binding a method
Instance Variable class​_id Undocumented
Instance Variable func​_id Undocumented
Instance Variable is​_class​_scope Undocumented
Instance Variable parent Undocumented
Instance Variable prohibited Undocumented
Instance Variable scope Undocumented
def __init__(self, parent=None, is_class_scope=False, prohibited=None): (source)

Initializer for TypeVarLikeScope

Parameters:

parent: the outer scope for this scope is_class_scope: True if this represents a generic class prohibited: Type variables that aren't strictly in scope exactly,

but can't be bound because they're part of an outer class's scope.
Parameters
parent:Optional[TypeVarLikeScope]Undocumented
is​_class​_scope:boolUndocumented
prohibited:Optional[TypeVarLikeScope]Undocumented
def __str__(self): (source)

Undocumented

Returns
strUndocumented
def allow_binding(self, fullname): (source)

Undocumented

Parameters
fullname:strUndocumented
Returns
boolUndocumented
def bind_existing(self, tvar_def): (source)

Undocumented

Parameters
tvar​_def:TypeVarLikeTypeUndocumented
def bind_new(self, name, tvar_expr): (source)

Undocumented

Parameters
name:strUndocumented
tvar​_expr:TypeVarLikeExprUndocumented
Returns
TypeVarLikeTypeUndocumented
def class_frame(self): (source)
A new scope frame for binding a class. Prohibits this class's tvars
Returns
TypeVarLikeScopeUndocumented
def get_binding(self, item): (source)

Undocumented

Parameters
item:Union[str, SymbolTableNode]Undocumented
Returns
Optional[TypeVarLikeType]Undocumented
def get_function_scope(self): (source)
Get the nearest parent that's a function scope, not a class scope
Returns
Optional[TypeVarLikeScope]Undocumented
def method_frame(self): (source)
A new scope frame for binding a method
Returns
TypeVarLikeScopeUndocumented
class_id = (source)

Undocumented

func_id = (source)

Undocumented

is_class_scope = (source)

Undocumented

parent = (source)

Undocumented

prohibited = (source)

Undocumented

scope: Dict[str, TypeVarLikeType] = (source)

Undocumented