Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
bf51e2ff
Commit
bf51e2ff
authored
Apr 02, 2017
by
Damien George
Browse files
tests/basics: Add tests for list and bytearray growing using themselves.
parent
a5500a8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/basics/bytearray_slice_assign.py
View file @
bf51e2ff
...
...
@@ -51,6 +51,11 @@ b = bytearray(10)
b
[:
-
1
]
=
bytearray
(
500
)
print
(
len
(
b
),
b
[
0
],
b
[
-
1
])
# extension with self on RHS
b
=
bytearray
(
x
)
b
[
4
:]
=
b
print
(
b
)
# Assignment of bytes to array slice
b
=
bytearray
(
2
)
b
[
1
:
1
]
=
b
"12345"
...
...
tests/basics/list_slice_assign_grow.py
View file @
bf51e2ff
...
...
@@ -26,3 +26,8 @@ print(l)
l
=
list
(
x
)
l
[
100
:
100
]
=
[
10
,
20
,
30
,
40
]
print
(
l
)
# growing by using itself on RHS
l
=
list
(
range
(
10
))
l
[
4
:]
=
l
print
(
l
)
Write
Preview
Supports
Markdown
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