MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / add

Function add

lib/sqlalchemy/orm/collections.py:1339–1349  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

1337 fn.__doc__ = getattr(set, fn.__name__).__doc__
1338
1339 def add(fn):
1340 def add(self, value, _sa_initiator=None):
1341 if value not in self:
1342 value = __set(self, value, _sa_initiator, NO_KEY)
1343 else:
1344 __set_wo_mutation(self, value, _sa_initiator)
1345 # testlib.pragma exempt:__hash__
1346 fn(self, value)
1347
1348 _tidy(add)
1349 return add
1350
1351 def discard(fn):
1352 def discard(self, value, _sa_initiator=None):

Callers

nothing calls this directly

Calls 3

__setFunction · 0.85
__set_wo_mutationFunction · 0.85
_tidyFunction · 0.85

Tested by

no test coverage detected