]> granicus.if.org Git - python/commitdiff
add example
authorBenjamin Peterson <benjamin@python.org>
Thu, 5 Mar 2009 00:17:57 +0000 (00:17 +0000)
committerBenjamin Peterson <benjamin@python.org>
Thu, 5 Mar 2009 00:17:57 +0000 (00:17 +0000)
Doc/library/symtable.rst

index 28306e673675218c4690927c6a5a0b5097d365da..9ea3f01b40799dc64e29fc5045a4b26ba0e25c61 100644 (file)
@@ -164,6 +164,12 @@ Examining Symbol Tables
       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.