Пример #1
0
        public static string dumps(object value, int version)
        {
            byte[]        bytes = MarshalOps.GetBytes(value, version);
            StringBuilder sb    = new StringBuilder(bytes.Length);

            for (int i = 0; i < bytes.Length; i++)
            {
                sb.Append((char)bytes[i]);
            }
            return(sb.ToString());
        }
Пример #2
0
 public static Bytes dumps(object value, int version = PythonMarshal.version)
 {
     return(Bytes.Make(MarshalOps.GetBytes(value, version)));
 }