Skip to content

Update symtable stubs for 3.13 and 3.14 #12183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion stdlib/symtable.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,30 @@ from typing import Any

__all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"]

if sys.version_info >= (3, 13):
__all__ += ["SymbolTableType"]

def symtable(code: str, filename: str, compile_type: str) -> SymbolTable: ...

if sys.version_info >= (3, 13):
from enum import StrEnum

class SymbolTableType(StrEnum):
MODULE = "module"
FUNCTION = "function"
CLASS = "class"
ANNOTATION = "annotation"
TYPE_ALIAS = "type alias"
TYPE_PARAMETERS = "type parameters"
TYPE_VARIABLE = "type variable"

class SymbolTable:
def __init__(self, raw_table: Any, filename: str) -> None: ...
def get_type(self) -> str: ...
if sys.version_info >= (3, 13):
def get_type(self) -> SymbolTableType: ...
else:
def get_type(self) -> str: ...

def get_id(self) -> int: ...
def get_name(self) -> str: ...
def get_lineno(self) -> int: ...
Expand Down Expand Up @@ -42,13 +61,23 @@ class Symbol:
def get_name(self) -> str: ...
def is_referenced(self) -> bool: ...
def is_parameter(self) -> bool: ...
if sys.version_info >= (3, 14):
def is_type_parameter(self) -> bool: ...

def is_global(self) -> bool: ...
def is_declared_global(self) -> bool: ...
def is_local(self) -> bool: ...
def is_annotated(self) -> bool: ...
def is_free(self) -> bool: ...
if sys.version_info >= (3, 14):
def is_free_class(self) -> bool: ...

def is_imported(self) -> bool: ...
def is_assigned(self) -> bool: ...
if sys.version_info >= (3, 14):
def is_comp_iter(self) -> bool: ...
def is_comp_cell(self) -> bool: ...

def is_namespace(self) -> bool: ...
def get_namespaces(self) -> Sequence[SymbolTable]: ...
def get_namespace(self) -> SymbolTable: ...
Expand Down
Loading