MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / go

Function go

lib/sqlalchemy/engine/reflection.py:116–131  ·  view source on GitHub ↗
(
        fn: Callable[..., _R],
        self: Dialect,
        con: Connection,
        *args: Any,
        **kw: Any,
    )

Source from the content-addressed store, hash-verified

114) -> Callable[[Callable[..., _R]], Callable[..., _R]]:
115 @util.decorator
116 def go(
117 fn: Callable[..., _R],
118 self: Dialect,
119 con: Connection,
120 *args: Any,
121 **kw: Any,
122 ) -> _R:
123 info_cache = kw.get("info_cache", None)
124 if info_cache is None:
125 return fn(self, con, *args, **kw)
126 key = _ad_hoc_cache_key_from_args((fn.__name__,), traverse_args, args)
127 ret: _R = info_cache.get(key)
128 if ret is None:
129 ret = fn(self, con, *args, **kw)
130 info_cache[key] = ret
131 return ret
132
133 return go
134

Callers 1

__aexit__Method · 0.50

Calls 2

getMethod · 0.45

Tested by

no test coverage detected