Commit 9c2e610f authored by Tom Niget's avatar Tom Niget

Add json module

parent 1178e59c
//
// Created by Tom on 04/07/2023.
//
#ifndef TYPON_JSON_HPP
#define TYPON_JSON_HPP
#include "builtins.hpp"
namespace py_json {
struct json_t {
template <typename T> typon::Task<void> dump(const T &x, PyFile &fp) {
std::stringstream ss;
repr_to(x, ss);
co_await fp.write(ss.str());
}
} all;
auto &get_all() { return all; }
} // namespace py_json
#endif // TYPON_JSON_HPP
# coding: utf-8
from typing import TypeVar
T = TypeVar("T")
def dump(obj: T, fp: file) -> Task[str]: ...
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment