Python etc / class body

class body

The class body is the same as, let's say, the function body, with only a few limitations. You can put any statements inside, reuse previous results and so on:

class A:
    print('hello')
    a = 1
    if a:
      b = a + 1
# hello

A.b
# 2