This ensures that the default Python definition is __setattr__ . It is usually used if the class has overridden __setattr__ to perform custom behavior, but you still want to access the original __setattr__ behavior.
In the case of werkzeug, if you look at the Local class, you will see that __setattr__ is defined as follows:
def __setattr__(self, name, value): ident = self.__ident_func__() storage = self.__storage__ try: storage[ident][name] = value except KeyError: storage[ident] = {name: value}
Instead of setting attributes in the dictionary of an object, it sets them in the dictionary __storage__ , which was initialized earlier. To set the __storage__ attribute __storage__ general (so that it can be accessed, for example, self.__storage__ later), the original __setattr__ definition from the object must be used, so the constructor uses an inconvenient notation.
source share