You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Symbol table for type parameter (PEP 695) raises AssertionError on get_type() #110045
Traceback (most recent call last):
File ".../bug_symtable.py", line 12, in <module>
print(t_T.get_type())
^^^^^^^^^^^^^^
File ".../3.12.0rc3/lib/python3.12/symtable.py", line 74, in get_type
assert self._table.type in (1, 2, 3), \
AssertionError: unexpected type: 6
[Finished in 1 seconds with code 1]
The symbol table for type parameters (generic) seem to have a new type, but it appears that the symtable implementation was not updated accordingly. Also there is no _symtable.TYPE_* constant for type code 6 (see _symtable).
- 0: FunctionBlock
- 1: ClassBlock
- 2: ModuleBlock
// Used for annotations 'from __future__ import annotations'
- 3: AnnotationBlock
// Used for generics and type aliases. These work mostly like functions
// (see PEP 695 for details). The three different blocks function identically;
// they are different enum entries only so that error messages can be more
// precise.
- 4: TypeVarBoundBlock
- 5: TypeAliasBlock
- 6: TypeParamBlock
changed the title [-]Python 3.12: symbol table for type parameter (PEP 695) raises AssertionError on get_type()[/-][+]Symbol table for type parameter (PEP 695) raises AssertionError on get_type()[/+]on Sep 29, 2023
Activity
AlexWaygood commentedon Sep 28, 2023
Cc. @JelleZijlstra @carljm
terryjreedy commentedon Sep 29, 2023
Same error on Windows 10 and main.
[-]Python 3.12: symbol table for type parameter (PEP 695) raises AssertionError on get_type()[/-][+]Symbol table for type parameter (PEP 695) raises AssertionError on get_type()[/+]pythongh-110045: Update symtable module for PEP 695
pythongh-110045: Update symtable module for PEP 695
gh-110045: Update symtable module for PEP 695 (#110066)
pythongh-110045: Update symtable module for PEP 695 (pythonGH-110066)
[3.12] gh-110045: Update symtable module for PEP 695 (GH-110066) (#11…
pythongh-110045: Update symtable module for PEP 695 (python#110066)