MCPcopy Index your code
hub / github.com/ray-project/ray / DataClass2

Class DataClass2

python/ray/tests/test_serialization.py:245–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243 DataClass1 = make_dataclass("DataClass1", [("custom", CustomClass)])
244
245 class DataClass2(DataClass1):
246 @classmethod
247 def from_custom(cls, data):
248 custom = CustomClass(data)
249 return cls(custom)
250
251 def __reduce__(self):
252 return (self.from_custom, (self.custom.value,))
253
254 CUSTOM_OBJECTS.append(DataClass2(custom=CustomClass(43)))
255

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…