code: def block(cls, method):
          
          def blocked_method(self, *a, **kw):
              raise cls(self, method.__name__, a, kw)
          return blocked_method
docs: This decorator raises a ConstraintError (or subclass) on any
          call to the given method.