(self)
| 860 | ) |
| 861 | |
| 862 | def __getstate__(self): |
| 863 | state = super().__getstate__() |
| 864 | state = list(state) |
| 865 | slots = self.__class__.get_all_slots() |
| 866 | ix = slots.index("kwargs") |
| 867 | # The constructor as a kwarg is redundant since this is encoded in the |
| 868 | # class itself. Serializing the builtin types is not trivial |
| 869 | # This saves about 15% of overhead |
| 870 | state[ix] = state[ix].copy() |
| 871 | state[ix].pop("constructor", None) |
| 872 | return state |
| 873 | |
| 874 | def __setstate__(self, state): |
| 875 | super().__setstate__(state) |
nothing calls this directly
no test coverage detected