def getInstanceState(inst, jellier):
 if hasattr(inst, '__getstate__'):
  state = inst.__getstate__()
 else:
  state = inst.__dict__
 sxp = jellier.prepare(inst)
 sxp.extend([qual(inst.__class__), jellier.jelly(state)])
 return jellier.preserve(inst, sxp)

def getInstanceState ( inst , jellier ) : if hasattr ( inst , '__getstate__' ) : state = inst . __getstate__ ( ) else : state = inst . __dict__ sxp = jellier . prepare ( inst ) sxp . extend ( [ qual ( inst . __class__ ) , jellier . jelly ( state ) ] ) return jellier . preserve ( inst , sxp )
utility method to default to normal state rules in serialization .