You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
360 B
20 lines
360 B
4 years ago
|
# test errors from bad operations (unary, binary, etc)
|
||
|
|
||
|
# unsupported unary operators
|
||
|
try:
|
||
|
~bytearray()
|
||
|
except TypeError:
|
||
|
print('TypeError')
|
||
|
|
||
|
# unsupported binary operators
|
||
|
try:
|
||
|
bytearray() // 2
|
||
|
except TypeError:
|
||
|
print('TypeError')
|
||
|
|
||
|
# object with buffer protocol needed on rhs
|
||
|
try:
|
||
|
bytearray(1) + 1
|
||
|
except TypeError:
|
||
|
print('TypeError')
|