8000 Update ``symtable`` stubs for 3.13 and 3.14 (#12183) · python/typeshed@6b4cd03 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b4cd03

Browse files
authored
Update symtable stubs for 3.13 and 3.14 (#12183)
1 parent d029c30 commit 6b4cd03

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

stdlib/symtable.pyi

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,30 @@ from typing import Any
55

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

8+
if sys.version_info >= (3, 13):
9+
__all__ += ["SymbolTableType"]
10+
811
def symtable(code: str, filename: str, compile_type: str) -> SymbolTable: ...
912

13+
if sys.version_info >= (3, 13):
14+
from enum import StrEnum
15+
16+
class SymbolTableType(StrEnum):
17+
MODULE = "module"
18+
FUNCTION = "function"
19+
CLASS = "class"
20+
ANNOTATION = "annotation"
21+
TYPE_ALIAS = "type alias"
22+
TYPE_PARAMETERS = "type parameters"
23+
TYPE_VARIABLE = "type variable"
24+
1025
class SymbolTable:
1126
def __init__(self, raw_table: Any, filename: str) -> None: ...
12-
def get_type(self) -> str: ...
27+
if sys.version_info >= (3, 13):
28+
def get_type(self) -> SymbolTableType: ...
29+
else:
30+
def get_type(self) -> str: ...
31+
1332
def get_id(self) -> int: ...
1433
def get_name(self) -> str: ...
1534
def get_lineno(self) -> int: ...
@@ -42,13 +61,23 @@ class Symbol:
4261
def get_name(self) -> str: ...
4362
def is_referenced(self) -> bool: ...
4463
def is_parameter(self) -> bool: ...
64+
if sys.version_info >= (3, 14):
65+
def is_type_parameter(self) -> bool: ...
66+
4567
def is_global(self) -> bool: ...
4668
def is_declared_global(self) -> bool: ...
4769
def is_local(self) -> bool: ...
4870
def is_annotated(self) -> bool: ...
4971
def is_free(self) -> bool: ...
72+
if sys.version_info >= (3, 14):
73+
def is_free_class(self) -> bool: ...
74+
5075
def is_imported(self) -> bool: ...
5176
def is_assigned(self) -> bool: ...
77+
if sys.version_info >= (3, 14):
78+
def is_comp_iter(self) -> bool: ...
79+
def is_comp_cell(self) -> bool: ...
80+
5281
def is_namespace(self) -> bool: ...
5382
def get_namespaces(self) -> Sequence[SymbolTable]: ...
5483
def get_namespace(self) -> SymbolTable: ...

0 commit comments

Comments
 (0)
0