micropython/tests/basics/slice_op.py
Damien George dd4767a7d1 tests/basics: Add .exp file for slice_op test.
CPython 3.12 implemented hashing for slices, so now differs to MicroPython.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-28 10:50:57 +10:00

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')