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
0157e7aa
Commit
0157e7aa
authored
Oct 12, 2000
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some single tuple/list unpacking for JPython regression testing.
parent
cb5b5bac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
Lib/test/test_unpack.py
Lib/test/test_unpack.py
+12
-0
No files found.
Lib/test/test_unpack.py
View file @
0157e7aa
...
...
@@ -47,6 +47,18 @@ a, b, c = Seq()
if
a
<>
0
or
b
<>
1
or
c
<>
2
:
raise
TestFailed
# single element unpacking, with extra syntax
if
verbose
:
print
'unpack single tuple/list'
st
=
(
99
,)
sl
=
[
100
]
a
,
=
st
if
a
<>
99
:
raise
TestFailed
b
,
=
sl
if
b
<>
100
:
raise
TestFailed
# now for some failures
# unpacking non-sequence
...
...
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