I saw this question on SO Prevent creating new attributes outside init which shows how to prevent adding new attributes to objects of classes.
I wanted the same behaviour for the overall class or even the complete loaded module.
Example class:
class Klass:
a = 0
b = 1
Another module:
from Klass import Klass
Klass.c = 2 # this should raise an error
Is this possible?