MCPcopy Create free account
hub / github.com/boostorg/histogram / getstate

Method getstate

src/python/serialization_suite.hpp:65–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63template <class T>
64struct serialization_suite : python::pickle_suite {
65 static python::tuple getstate(python::object obj) {
66 PyObject* pobj = nullptr;
67 iostreams::stream<detail::python_bytes_sink> os(&pobj);
68 archive::text_oarchive oa(os);
69 oa << python::extract<const T&>(obj)();
70 os.flush();
71 return python::make_tuple(obj.attr("__dict__"),
72 python::object(python::handle<>(pobj)));
73 }
74
75 static void setstate(python::object obj, python::tuple state) {
76 // restore the object's __dict__

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected