MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / constructor_key

Function constructor_key

lib/sqlalchemy/util/langhelpers.py:1467–1475  ·  view source on GitHub ↗

Produce a tuple structure that is cacheable using the __dict__ of obj to retrieve values

(obj: Any, cls: Type[Any])

Source from the content-addressed store, hash-verified

1465
1466
1467def constructor_key(obj: Any, cls: Type[Any]) -> Tuple[Any, ...]:
1468 """Produce a tuple structure that is cacheable using the __dict__ of
1469 obj to retrieve values
1470
1471 """
1472 names = get_cls_kwargs(cls)
1473 return (cls,) + tuple(
1474 (k, obj.__dict__[k]) for k in names if k in obj.__dict__
1475 )
1476
1477
1478def constructor_copy(obj: _T, cls: Type[_T], *args: Any, **kw: Any) -> _T:

Callers

nothing calls this directly

Calls 1

get_cls_kwargsFunction · 0.85

Tested by

no test coverage detected