From: Benjamin Peterson Date: Thu, 5 Mar 2009 00:17:57 +0000 (+0000) Subject: add example X-Git-Tag: v2.7a1~1895 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c51ec0a9e381590858f122ec2f5c4d97ae89b0c7;p=thirdparty%2FPython%2Fcpython.git add example --- diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst index 28306e673675..9ea3f01b4079 100644 --- a/Doc/library/symtable.rst +++ b/Doc/library/symtable.rst @@ -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.