summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/builtin_delattr.py
blob: 9b38837e44ddf801b104146b4174410e41ef737a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# test builtin delattr
try:
    delattr
except:
    import sys
    print("SKIP")
    sys.exit()

class A: pass
a = A()
a.x = 1
print(a.x)

delattr(a, 'x')

try:
    a.x
except AttributeError:
    print('AttributeError')

try:
    delattr(a, 'x')
except AttributeError:
    print('AttributeError')