On this page
  1. symtable.Symbol
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

symtable.Symbol

Prev: symtable.Function | Up: symtable | Next: symtable.SymbolTable
Rel: symtable.Class, symtable.Function, symtable.SymbolTable, symtable.SymbolTableType
Ref: docs.python.org — symtable.Symbol
Tags: #public #python3 #stdlib #symtable


Import

import symtable
from symtable import Symbol

Signature & Overview

symtable.Symbol(name, flags, namespaces=None, *, module_scope=False)

symtable.Symbol class.

Methods & Attributes

Usage

import symtable

tbl = symtable.symtable('def f(x): return x', '<m>', 'exec')
sym = tbl.get_children()[0].lookup('x')
assert isinstance(sym, symtable.Symbol) and sym.is_parameter()

Gotchas

REPL Inspect

from symtable import Symbol
help(Symbol)

Linked from

Related notes