x = a + 1 # a is not yet defined a = x + 1 class A: def __init__(self, rarely_used_parameter=False): if rarely_used_parameter: self.m += 1 # the member 'm' is not yet initialised, but if the testing happens to never set the 'rarely_used_parameter' to True, this error may go undetected self.m = 0 def inc(self): self.m += self.n # A does not have a member named 'n'. def init_x(self): self.x = 5 # any member variables should be defined in the init method def use_x(self): self.x += 1 # this will cause an error if init_x is not called beforehand