summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/op_error_bytearray.py
blob: 9ab69371d22de0f316e3f60ac7d402d03dea7bcd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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')