mirror of
https://github.com/W3SLAV/micropython.git
synced 2025-06-19 03:55:44 -04:00

CPython 3.12 implemented hashing for slices, so now differs to MicroPython. Signed-off-by: Damien George <damien@micropython.org>
18 lines
366 B
Python
18 lines
366 B
Python
# Test slice unary operations.
|
|
# CPython allows hashing slices, but MicroPython does not.
|
|
|
|
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')
|