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
20861374
Commit
20861374
authored
Nov 25, 2005
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use sorted() builtin
parent
845acca3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
Lib/compiler/symbols.py
Lib/compiler/symbols.py
+5
-10
No files found.
Lib/compiler/symbols.py
View file @
20861374
...
...
@@ -409,13 +409,8 @@ class SymbolVisitor:
scope
.
generator
=
1
self
.
visit
(
node
.
value
,
scope
)
def
sort
(
l
):
l
=
l
[:]
l
.
sort
()
return
l
def
list_eq
(
l1
,
l2
):
return
sort
(
l1
)
==
sort
(
l2
)
return
sort
ed
(
l1
)
==
sorted
(
l2
)
if
__name__
==
"__main__"
:
import
sys
...
...
@@ -443,8 +438,8 @@ if __name__ == "__main__":
if
not
list_eq
(
mod_names
,
names2
):
print
print
"oops"
,
file
print
sort
(
mod_names
)
print
sort
(
names2
)
print
sort
ed
(
mod_names
)
print
sort
ed
(
names2
)
sys
.
exit
(
-
1
)
d
=
{}
...
...
@@ -463,6 +458,6 @@ if __name__ == "__main__":
if
not
list_eq
(
get_names
(
s
.
get_namespace
()),
l
[
0
].
get_names
()):
print
s
.
get_name
()
print
sort
(
get_names
(
s
.
get_namespace
()))
print
sort
(
l
[
0
].
get_names
())
print
sort
ed
(
get_names
(
s
.
get_namespace
()))
print
sort
ed
(
l
[
0
].
get_names
())
sys
.
exit
(
-
1
)
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