def marshal_w__Complex(space, w_complex, m): if m.version > 1: m.start(TYPE_BINARY_COMPLEX) m.put(pack_float(w_complex.realval)) m.put(pack_float(w_complex.imagval)) else: # XXX a bit too wrap-happy w_real = space.wrap(w_complex.realval) w_imag = space.wrap(w_complex.imagval) m.start(TYPE_COMPLEX) m.put_pascal(space.str_w(repr_float(space, w_real))) m.put_pascal(space.str_w(repr_float(space, w_imag)))
def marshal_w__Float(space, w_float, m): if m.version > 1: m.start(TYPE_BINARY_FLOAT) m.put(pack_float(w_float.floatval)) else: m.start(TYPE_FLOAT) m.put_pascal(space.str_w(repr_float(space, w_float)))