- the "modified" flag is set to False
- any "expired" markers/callables for attributes loaded are removed.
- Attributes marked as "expired" can potentially remain "expired" after this step
- if a value was not populated in state.dict.
+ Attributes marked as "expired" can potentially remain
+ "expired" after this step if a value was not populated in state.dict.
+ self.commit_all_states([(self, dict_)], instance_dict)
- self.__dict__.pop('_pending_mutations', None)
+ def commit_all_states(self, iter, instance_dict=None):
+ """Mass version of commit_all()."""
- callables = self.callables
- for key in list(callables):
- if key in dict_ and callables[key] is self:
+ for state, dict_ in iter:
+ state.__dict__.pop('_pending_mutations', None)
- if instance_dict and self.modified:
+ callables = state.callables
+ for key in list(callables):
+ if key in dict_ and callables[key] is state:
- self.modified = self.expired = False
- self._strong_obj = None
+ if instance_dict and state.modified:
+ state.modified = state.expired = False
+ state._strong_obj = None
"""Provide inspection interface to an object's state."""