summaryrefslogtreecommitdiff
path: root/tests/internal_bench/var-9.6-except_error_special.py
blob: 8bc395b4d7ef87cb8759cc23912980092534e5d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import bench


class Foo:
    def __delattr__(self, name):  # just trigger the 'special lookups' flag on the class
        pass


def test(num):
    o = Foo()

    def get():
        try:
            return o.num
        except AttributeError:
            return num

    i = 0
    while i < get():
        i += 1


bench.run(test)