diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-05 00:17:57 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-05 00:17:57 (GMT) |
commit | c51ec0a9e381590858f122ec2f5c4d97ae89b0c7 (patch) | |
tree | 7a2c7c3746022f95c93c5727ea6897dbb70d673d /Doc/library/symtable.rst | |
parent | 1ea79913b9e877c8352a3c166ea39d206d349c9d (diff) | |
download | cpython-c51ec0a9e381590858f122ec2f5c4d97ae89b0c7.zip cpython-c51ec0a9e381590858f122ec2f5c4d97ae89b0c7.tar.gz cpython-c51ec0a9e381590858f122ec2f5c4d97ae89b0c7.tar.bz2 |
add example
Diffstat (limited to 'Doc/library/symtable.rst')
-rw-r--r-- | Doc/library/symtable.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst index 28306e6..9ea3f01 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. |