Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b8174073
Commit
b8174073
authored
Mar 23, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flesh out __all__
remove debugging code in if __debug__: add get_children() method on SymbolTable
parent
c1823453
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
Lib/symtable.py
Lib/symtable.py
+6
-14
No files found.
Lib/symtable.py
View file @
b8174073
...
...
@@ -8,7 +8,8 @@ from _symtable import USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, \
import
weakref
__all__
=
[
"symtable"
,
"SymbolTable"
,
"newSymbolTable"
]
__all__
=
[
"symtable"
,
"SymbolTable"
,
"newSymbolTable"
,
"Class"
,
"Function"
,
"Symbol"
]
def
symtable
(
code
,
filename
,
compile_type
):
raw
=
_symtable
.
symtable
(
code
,
filename
,
compile_type
)
...
...
@@ -117,6 +118,10 @@ class SymbolTable:
for
st
in
self
.
_table
.
children
if
st
.
name
==
name
]
def
get_children
(
self
):
return
[
newSymbolTable
(
st
,
self
.
_filename
)
for
st
in
self
.
_table
.
children
]
class
Function
(
SymbolTable
):
# Default values for instance variables
...
...
@@ -236,19 +241,6 @@ class Symbol:
raise
ValueError
,
"name is bound to multiple namespaces"
return
self
.
__namespaces
[
0
]
if
__debug__
:
class
Foo
:
version
=
1
class
Foo
:
version
=
2
class
Foo
:
version
=
3
def
execfunc
(
x
):
exec
x
in
y
if
__name__
==
"__main__"
:
import
os
,
sys
src
=
open
(
sys
.
argv
[
0
]).
read
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment