# Sichtbarkeitsregeln (scoping rules)

class Foo(object):
    def bar(self):
        print("bar!")
    def spam(self):
        try:
            bar(self) # Fehler: 'bar' erzeugt einen NameError
        except Exception as e:
            print(e)
        self.bar()    # OK
        Foo.bar(self) # auch OK

    bar(None)

Foo().bar()
Foo().spam()
