py/objarray: Disallow memoryview addition.

Following CPython.  This is important for subsequent commits to work
correctly.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2023-05-12 23:14:44 +10:00
parent 9accb7dd44
commit ca9068e0ef
2 changed files with 17 additions and 1 deletions

View File

@@ -6,8 +6,18 @@ except:
raise SystemExit
# unsupported binary operators
try:
memoryview(b"") + b""
except TypeError:
print("TypeError")
try:
memoryview(b"") + memoryview(b"")
except TypeError:
print("TypeError")
try:
m = memoryview(bytearray())
m += bytearray()
except TypeError:
print('TypeError')
print("TypeError")