From b9ad9f18c2a070ad83cd37d12869fae7c9fd6701 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 15 Oct 2023 15:43:00 +0800 Subject: [PATCH] docs update --- docs/modules/json.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/modules/json.md b/docs/modules/json.md index 056d02eb..e1dc9853 100644 --- a/docs/modules/json.md +++ b/docs/modules/json.md @@ -3,14 +3,17 @@ icon: package label: json --- +pkpy has two JSON modules. +1. The built-in JSON module is always available and can be imported via `import json`. +2. After `v1.2.7`, you can set `PK_USE_CJSON` to `ON` in CMakeLists.txt to enable an alternative JSON module `cjson`. + +Their interfaces are the same, `cjson` is faster while the built-in `json` is more stable since it was developed earlier. + ### `json.loads(s)` Decode a JSON string into a python object. -It is supported by the `eval()` function. - ### `json.dumps(obj)` Encode a python object into a JSON string. -It is supported by the compiler with `JSON_MODE` enabled.