MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / intersection_update

Function intersection_update

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

Source from the content-addressed store, hash-verified

1429 return __isub__
1430
1431 def intersection_update(fn):
1432 def intersection_update(self, other):
1433 want, have = self.intersection(other), set(self)
1434 remove, add = have - want, want - have
1435
1436 for item in remove:
1437 self.remove(item)
1438 for item in add:
1439 self.add(item)
1440
1441 _tidy(intersection_update)
1442 return intersection_update
1443
1444 def __iand__(fn):
1445 def __iand__(self, other):

Callers

nothing calls this directly

Calls 4

_tidyFunction · 0.85
intersectionMethod · 0.45
removeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected