MCPcopy Create free account
hub / github.com/apache/madlib / set_python_instance_state

Method set_python_instance_state

src/madpack/yaml/constructor.py:551–563  ·  view source on GitHub ↗
(self, instance, state)

Source from the content-addressed store, hash-verified

549 return cls(*args, **kwds)
550
551 def set_python_instance_state(self, instance, state):
552 if hasattr(instance, '__setstate__'):
553 instance.__setstate__(state)
554 else:
555 slotstate = {}
556 if isinstance(state, tuple) and len(state) == 2:
557 state, slotstate = state
558 if hasattr(instance, '__dict__'):
559 instance.__dict__.update(state)
560 elif state:
561 slotstate.update(state)
562 for key, value in slotstate.items():
563 setattr(object, key, value)
564
565 def construct_python_object(self, suffix, node):
566 # Format:

Callers 2

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected