gh-120029: make symtable.Symbol.__repr__ correctly reflect the compiler's flags, add methods (#120099)

Expose :class:`symtable.Symbol` methods :meth:`~symtable.Symbol.is_free_class`,
:meth:`~symtable.Symbol.is_comp_iter` and :meth:`~symtable.Symbol.is_comp_cell`.

---------

Co-authored-by: Carl Meyer <carl@oddbird.net>
This commit is contained in:
Bénédikt Tran 2024-06-12 13:14:50 +02:00 committed by GitHub
parent 7dd8c37a06
commit 755dab719d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 100 additions and 6 deletions

View file

@ -81,6 +81,8 @@ symtable_init_constants(PyObject *m)
if (PyModule_AddIntMacro(m, DEF_IMPORT) < 0) return -1;
if (PyModule_AddIntMacro(m, DEF_BOUND) < 0) return -1;
if (PyModule_AddIntMacro(m, DEF_ANNOT) < 0) return -1;
if (PyModule_AddIntMacro(m, DEF_COMP_ITER) < 0) return -1;
if (PyModule_AddIntMacro(m, DEF_COMP_CELL) < 0) return -1;
if (PyModule_AddIntConstant(m, "TYPE_FUNCTION", FunctionBlock) < 0)
return -1;