MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / check

Function check

lib/sqlalchemy/sql/base.py:316–329  ·  view source on GitHub ↗
(fn: _Fn, *args: Any, **kw: Any)

Source from the content-addressed store, hash-verified

314
315 @util.decorator
316 def check(fn: _Fn, *args: Any, **kw: Any) -> Any:
317 # make pylance happy by not including "self" in the argument
318 # list
319 self = args[0]
320 args = args[1:]
321 for name, getter, default_ in getters:
322 if getter(self) is not default_:
323 msg = msgs.get(
324 name,
325 "Method %s() has already been invoked on this %s construct"
326 % (fn.__name__, self.__class__),
327 )
328 raise exc.InvalidRequestError(msg)
329 return fn(self, *args, **kw)
330
331 return check
332

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected