57365d8557
Array equality is defined as each element being equal but to keep code size down MicroPython implements a binary comparison. This can only be used correctly for elements with the same binary layout though so turn it into an NotImplementedError when comparing types for which the binary comparison yielded incorrect results: types with different sizes, and floating point numbers because nan != nan.
10 lines
224 B
Python
10 lines
224 B
Python
"""
|
|
categories: Modules,array
|
|
description: Comparison between different typecodes not supported
|
|
cause: Code size
|
|
workaround: Compare individual elements
|
|
"""
|
|
import array
|
|
|
|
array.array("b", [1, 2]) == array.array("i", [1, 2])
|