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
Method new_unique_func_id Used by plugin-like code that needs to make synthetic generic functions.
Instance Variable class_id Undocumented
Instance Variable func_id Undocumented
Instance Variable is_class_scope Undocumented
Instance Variable namespace Undocumented
Instance Variable parent Undocumented
Instance Variable prohibited Undocumented
Instance Variable scope Undocumented
def __init__(self, parent: TypeVarLikeScope|None = None, is_class_scope: bool = False, prohibited: TypeVarLikeScope|None = None, namespace: str = ''): (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.

def __str__(self) -> str: (source)

Undocumented

def allow_binding(self, fullname: str) -> bool: (source)

Undocumented

def bind_existing(self, tvar_def: TypeVarLikeType): (source)

Undocumented

def bind_new(self, name: str, tvar_expr: TypeVarLikeExpr) -> TypeVarLikeType: (source)

Undocumented

def class_frame(self, namespace: str) -> TypeVarLikeScope: (source)

A new scope frame for binding a class. Prohibits *this* class's tvars

def get_binding(self, item: str|SymbolTableNode) -> TypeVarLikeType|None: (source)

Undocumented

def get_function_scope(self) -> TypeVarLikeScope|None: (source)

Get the nearest parent that's a function scope, not a class scope

def method_frame(self) -> TypeVarLikeScope: (source)

A new scope frame for binding a method

def new_unique_func_id(self) -> int: (source)

Used by plugin-like code that needs to make synthetic generic functions.

class_id = (source)

Undocumented

Undocumented

is_class_scope = (source)

Undocumented

namespace = (source)

Undocumented

Undocumented

prohibited = (source)

Undocumented