[Python-checkins] r70183 - python/trunk/Doc/library/symtable.rst
benjamin.peterson
python-checkins at python.org
Thu Mar 5 01:17:57 CET 2009
Author: benjamin.peterson
Date: Thu Mar 5 01:17:57 2009
New Revision: 70183
Log:
add example
Modified:
python/trunk/Doc/library/symtable.rst
Modified: python/trunk/Doc/library/symtable.rst
==============================================================================
--- python/trunk/Doc/library/symtable.rst (original)
+++ python/trunk/Doc/library/symtable.rst Thu Mar 5 01:17:57 2009
@@ -164,6 +164,12 @@
If the name is used as the target of a function or class statement, this
will be true.
+ For example::
+
+ >>> table = symtable.symtable("def some_func(): pass", "string", "exec")
+ >>> table.lookup("some_func").is_namespace()
+ True
+
Note that a single name can be bound to multiple objects. If the result
is ``True``, the name may also be bound to other objects, like an int or
list, that does not introduce a new namespace.
More information about the Python-checkins
mailing list