Return the type of the symbol table. The value returned is one of the values in the ``SymbolTableType`` enumeration.
(self)
| 78 | self._filename) |
| 79 | |
| 80 | def get_type(self): |
| 81 | """Return the type of the symbol table. |
| 82 | |
| 83 | The value returned is one of the values in |
| 84 | the ``SymbolTableType`` enumeration. |
| 85 | """ |
| 86 | if self._table.type == _symtable.TYPE_MODULE: |
| 87 | return SymbolTableType.MODULE |
| 88 | if self._table.type == _symtable.TYPE_FUNCTION: |
| 89 | return SymbolTableType.FUNCTION |
| 90 | if self._table.type == _symtable.TYPE_CLASS: |
| 91 | return SymbolTableType.CLASS |
| 92 | if self._table.type == _symtable.TYPE_ANNOTATION: |
| 93 | return SymbolTableType.ANNOTATION |
| 94 | if self._table.type == _symtable.TYPE_TYPE_ALIAS: |
| 95 | return SymbolTableType.TYPE_ALIAS |
| 96 | if self._table.type == _symtable.TYPE_TYPE_PARAMETERS: |
| 97 | return SymbolTableType.TYPE_PARAMETERS |
| 98 | if self._table.type == _symtable.TYPE_TYPE_VARIABLE: |
| 99 | return SymbolTableType.TYPE_VARIABLE |
| 100 | assert False, f"unexpected type: {self._table.type}" |
| 101 | |
| 102 | def get_id(self): |
| 103 | """Return an identifier for the table. |
no outgoing calls