2024-05-28 10:50:57 +10:00
|
|
|
# Test slice unary operations.
|
|
|
|
|
# CPython allows hashing slices, but MicroPython does not.
|
2023-01-12 19:51:45 -06:00
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
t = [][:]
|
|
|
|
|
except:
|
|
|
|
|
print("SKIP")
|
|
|
|
|
raise SystemExit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# REVISIT: slice comparison operators are not implemented in MicroPython
|
|
|
|
|
|
|
|
|
|
# test that slice is not hashable, i.e. it can't be used to copy a dict
|
|
|
|
|
try:
|
|
|
|
|
{}[:] = {}
|
|
|
|
|
except TypeError:
|
|
|
|
|
print('TypeError')
|