(self)
| 848 | ) |
| 849 | |
| 850 | def __getstate__(self): |
| 851 | state = super().__getstate__() |
| 852 | state = list(state) |
| 853 | slots = self.__class__.get_all_slots() |
| 854 | ix = slots.index("kwargs") |
| 855 | # The constructor as a kwarg is redundant since this is encoded in the |
| 856 | # class itself. Serializing the builtin types is not trivial |
| 857 | # This saves about 15% of overhead |
| 858 | state[ix] = state[ix].copy() |
| 859 | state[ix].pop("constructor", None) |
| 860 | return state |
| 861 | |
| 862 | def __setstate__(self, state): |
| 863 | super().__setstate__(state) |
nothing calls this directly
no test coverage detected