MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __call__

Method __call__

lib/sqlalchemy/util/_collections.py:604–609  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

602 self.registry = {}
603
604 def __call__(self) -> _T:
605 key = self.scopefunc()
606 try:
607 return self.registry[key] # type: ignore[no-any-return]
608 except KeyError:
609 return self.registry.setdefault(key, self.createfunc()) # type: ignore[no-any-return] # noqa: E501
610
611 def has(self) -> bool:
612 """Return True if an object is present in the current scope."""

Callers

nothing calls this directly

Calls 2

createfuncMethod · 0.80
setdefaultMethod · 0.45

Tested by

no test coverage detected