symtable - pydoc - phpman

Look up a command

 

Markdown Format | JSON API | MCP Server Tool


symtable
NAME MODULE REFERENCE CLASSES FUNCTIONS DATA FILE
Help on module symtable:

NAME
    symtable - Interface to the compiler's internal symbol tables

MODULE REFERENCE
    https://docs.python.org/3.10/library/symtable.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

CLASSES
    builtins.object
        Symbol
        SymbolTable
            Class
            Function

    class Class(SymbolTable)
     |  Class(raw_table, filename)
     |
     |  Method resolution order:
     |      Class
     |      SymbolTable
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  get_methods(self)
     |      Return a tuple of methods declared in the class.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SymbolTable:
     |
     |  __init__(self, raw_table, filename)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  get_children(self)
     |      Return a list of the nested symbol tables.
     |
     |  get_id(self)
     |      Return an identifier for the table.
     |
     |  get_identifiers(self)
     |      Return a view object containing the names of symbols in the table.
     |
     |  get_lineno(self)
     |      Return the number of the first line in the
     |      block for the table.
     |
     |  get_name(self)
     |      Return the table's name.
     |
     |      This corresponds to the name of the class, function
     |      or 'top' if the table is for a class, function or
     |      global respectively.
     |
     |  get_symbols(self)
     |      Return a list of *Symbol* instances for
     |      names in the table.
     |
     |  get_type(self)
     |      Return the type of the symbol table.
     |
     |      The values retuned are 'class', 'module' and
     |      'function'.
     |
     |  has_children(self)
     |      Return *True* if the block has nested namespaces.
     |
     |  is_nested(self)
     |      Return *True* if the block is a nested class
     |      or function.
     |
     |  is_optimized(self)
     |      Return *True* if the locals in the table
     |      are optimizable.
     |
     |  lookup(self, name)
     |      Lookup a *name* in the table.
     |
     |      Returns a *Symbol* instance.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SymbolTable:
     |
     |  __dict__
     |      dictionary for instance variables (if defined)
     |
     |  __weakref__
     |      list of weak references to the object (if defined)

    class Function(SymbolTable)
     |  Function(raw_table, filename)
     |
     |  Method resolution order:
     |      Function
     |      SymbolTable
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  get_frees(self)
     |      Return a tuple of free variables in the function.
     |
     |  get_globals(self)
     |      Return a tuple of globals in the function.
     |
     |  get_locals(self)
     |      Return a tuple of locals in the function.
     |
     |  get_nonlocals(self)
     |      Return a tuple of nonlocals in the function.
     |
     |  get_parameters(self)
     |      Return a tuple of parameters to the function.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SymbolTable:
     |
     |  __init__(self, raw_table, filename)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  get_children(self)
     |      Return a list of the nested symbol tables.
     |
     |  get_id(self)
     |      Return an identifier for the table.
     |
     |  get_identifiers(self)
     |      Return a view object containing the names of symbols in the table.
     |
     |  get_lineno(self)
     |      Return the number of the first line in the
     |      block for the table.
     |
     |  get_name(self)
     |      Return the table's name.
     |
     |      This corresponds to the name of the class, function
     |      or 'top' if the table is for a class, function or
     |      global respectively.
     |
     |  get_symbols(self)
     |      Return a list of *Symbol* instances for
     |      names in the table.
     |
     |  get_type(self)
     |      Return the type of the symbol table.
     |
     |      The values retuned are 'class', 'module' and
     |      'function'.
     |
     |  has_children(self)
     |      Return *True* if the block has nested namespaces.
     |
     |  is_nested(self)
     |      Return *True* if the block is a nested class
     |      or function.
     |
     |  is_optimized(self)
     |      Return *True* if the locals in the table
     |      are optimizable.
     |
     |  lookup(self, name)
     |      Lookup a *name* in the table.
     |
     |      Returns a *Symbol* instance.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SymbolTable:
     |
     |  __dict__
     |      dictionary for instance variables (if defined)
     |
     |  __weakref__
     |      list of weak references to the object (if defined)

    class Symbol(builtins.object)
     |  Symbol(name, flags, namespaces=None, *, module_scope=False)
     |
     |  Methods defined here:
     |
     |  __init__(self, name, flags, namespaces=None, *, module_scope=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  get_name(self)
     |      Return a name of a symbol.
     |
     |  get_namespace(self)
     |      Return the single namespace bound to this name.
     |
     |      Raises ValueError if the name is bound to multiple namespaces.
     |
     |  get_namespaces(self)
     |      Return a list of namespaces bound to this name
     |
     |  is_annotated(self)
     |      Return *True* if the symbol is annotated.
     |
     |  is_assigned(self)
     |      Return *True* if a symbol is assigned to.
     |
     |  is_declared_global(self)
     |      Return *True* if the symbol is declared global
     |      with a global statement.
     |
     |  is_free(self)
     |      Return *True* if a referenced symbol is
     |      not assigned to.
     |
     |  is_global(self)
     |      Return *True* if the sysmbol is global.
     |
     |  is_imported(self)
     |      Return *True* if the symbol is created from
     |      an import statement.
     |
     |  is_local(self)
     |      Return *True* if the symbol is local.
     |
     |  is_namespace(self)
     |      Returns *True* if name binding introduces new namespace.
     |
     |      If the name is used as the target of a function or class
     |      statement, this will be true.
     |
     |      Note that a single name can be bound to multiple objects.  If
     |      is_namespace() is true, the name may also be bound to other
     |      objects, like an int or list, that does not introduce a new
     |      namespace.
     |
     |  is_nonlocal(self)
     |      Return *True* if the symbol is nonlocal.
     |
     |  is_parameter(self)
     |      Return *True* if the symbol is a parameter.
     |
     |  is_referenced(self)
     |      Return *True* if the symbol is used in
     |      its block.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables (if defined)
     |
     |  __weakref__
     |      list of weak references to the object (if defined)

    class SymbolTable(builtins.object)
     |  SymbolTable(raw_table, filename)
     |
     |  Methods defined here:
     |
     |  __init__(self, raw_table, filename)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  get_children(self)
     |      Return a list of the nested symbol tables.
     |
     |  get_id(self)
     |      Return an identifier for the table.
     |
     |  get_identifiers(self)
     |      Return a view object containing the names of symbols in the table.
     |
     |  get_lineno(self)
     |      Return the number of the first line in the
     |      block for the table.
     |
     |  get_name(self)
     |      Return the table's name.
     |
     |      This corresponds to the name of the class, function
     |      or 'top' if the table is for a class, function or
     |      global respectively.
     |
     |  get_symbols(self)
     |      Return a list of *Symbol* instances for
     |      names in the table.
     |
     |  get_type(self)
     |      Return the type of the symbol table.
     |
     |      The values retuned are 'class', 'module' and
     |      'function'.
     |
     |  has_children(self)
     |      Return *True* if the block has nested namespaces.
     |
     |  is_nested(self)
     |      Return *True* if the block is a nested class
     |      or function.
     |
     |  is_optimized(self)
     |      Return *True* if the locals in the table
     |      are optimizable.
     |
     |  lookup(self, name)
     |      Lookup a *name* in the table.
     |
     |      Returns a *Symbol* instance.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables (if defined)
     |
     |  __weakref__
     |      list of weak references to the object (if defined)

FUNCTIONS
    symtable(code, filename, compile_type)
        Return the toplevel *SymbolTable* for the source code.

        *filename* is the name of the file with the code
        and *compile_type* is the *compile()* mode argument.

DATA
    __all__ = ['symtable', 'SymbolTable', 'Class', 'Function', 'Symbol']

FILE
    /usr/lib/python3.10/symtable.py



Generated by phpMan Author: Che Dong Under GNU General Public License
2026-06-02 05:13 @216.73.216.198 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 TransitionalValid CSS!

^_back to top