MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _lazy_collection

Class _lazy_collection

lib/sqlalchemy/ext/associationproxy.py:1358–1373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1356
1357
1358class _lazy_collection(_LazyCollectionProtocol[_T]):
1359 def __init__(self, obj: Any, target: str):
1360 self.parent = obj
1361 self.target = target
1362
1363 def __call__(
1364 self,
1365 ) -> Union[MutableSet[_T], MutableMapping[Any, _T], MutableSequence[_T]]:
1366 return getattr(self.parent, self.target) # type: ignore[no-any-return]
1367
1368 def __getstate__(self) -> Any:
1369 return {"obj": self.parent, "target": self.target}
1370
1371 def __setstate__(self, state: Any) -> None:
1372 self.parent = state["obj"]
1373 self.target = state["target"]
1374
1375
1376_IT = TypeVar("_IT", bound="Any")

Callers 1

getMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected