MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _set

Method _set

lib/sqlalchemy/ext/associationproxy.py:1006–1021  ·  view source on GitHub ↗
(
        self, proxy: _AssociationCollection[Any], values: Iterable[Any]
    )

Source from the content-addressed store, hash-verified

1004 )
1005
1006 def _set(
1007 self, proxy: _AssociationCollection[Any], values: Iterable[Any]
1008 ) -> None:
1009 if self.parent.proxy_bulk_set:
1010 self.parent.proxy_bulk_set(proxy, values)
1011 elif self.collection_class is list:
1012 cast("_AssociationList[Any]", proxy).extend(values)
1013 elif self.collection_class is dict:
1014 cast("_AssociationDict[Any, Any]", proxy).update(values)
1015 elif self.collection_class is set:
1016 cast("_AssociationSet[Any]", proxy).update(values)
1017 else:
1018 raise exc.ArgumentError(
1019 "no proxy_bulk_set supplied for custom "
1020 "collection_class implementation"
1021 )
1022
1023 def _inflate(self, proxy: _AssociationCollection[Any]) -> None:
1024 creator = (

Callers

nothing calls this directly

Calls 3

castFunction · 0.50
extendMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected