Skip to content

fix: faq 4 sample code #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/user_docs/support/faq-kcl.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ schema Person:
We can use the union operator `|` or the dict unpacking operator `**` to add elements into a dict, and we can use `in` and `not in` operators to determine whether the dict variable contains a certain key.

```python
_left = {key = {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -110,9 +110,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

It is also possible to add key-value pair to a dict using the `string interpolation` or the string `format` method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ schema Person:
可以使用 union 运算符 `|`, 或者 dict 解包运算符 `**` 来向 dict 中添加一个元素,并且可以使用 `in`,`not in` 等关键字判断 dict 变量当中是否包含某一个键值

```python
_left = {key = {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -112,9 +112,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

此外还可以使用 `字符串插值` 或者字符串 `format` 成员函数特性向 kcl dict 添加变量键值对
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ schema Person:
可以使用 union 运算符 `|`, 或者 dict 解包运算符 `**` 来向 dict 中添加一个元素,并且可以使用 `in`,`not in` 等关键字判断 dict 变量当中是否包含某一个键值

```python
_left = {key = {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -112,9 +112,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

此外还可以使用 `字符串插值` 或者字符串 `format` 成员函数特性向 kcl dict 添加变量键值对
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ schema Person:
可以使用 union 运算符 `|`, 或者 dict 解包运算符 `**` 来向 dict 中添加一个元素,并且可以使用 `in`,`not in` 等关键字判断 dict 变量当中是否包含某一个键值

```python
_left = {key = {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -112,9 +112,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

此外还可以使用 `字符串插值` 或者字符串 `format` 成员函数特性向 kcl dict 添加变量键值对
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ schema Person:
可以使用 union 运算符 `|`, 或者 dict 解包运算符 `**` 来向 dict 中添加一个元素,并且可以使用 `in`,`not in` 等关键字判断 dict 变量当中是否包含某一个键值

```python
_left = {key = {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -112,9 +112,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

此外还可以使用 `字符串插值` 或者字符串 `format` 成员函数特性向 kcl dict 添加变量键值对
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ schema Person:
可以使用 union 运算符 `|`, 或者 dict 解包运算符 `**` 来向 dict 中添加一个元素,并且可以使用 `in`,`not in` 等关键字判断 dict 变量当中是否包含某一个键值

```python
_left = {key = {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -112,9 +112,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

此外还可以使用 `字符串插值` 或者字符串 `format` 成员函数特性向 kcl dict 添加变量键值对
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ schema Person:
可以使用 union 运算符 `|`, 或者 dict 解包运算符 `**` 来向 dict 中添加一个元素,并且可以使用 `in`,`not in` 等关键字判断 dict 变量当中是否包含某一个键值

```python
_left = {key = {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # 注意使用 = 表示覆盖
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -112,9 +112,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

此外还可以使用 `字符串插值` 或者字符串 `format` 成员函数特性向 kcl dict 添加变量键值对
Expand Down
7 changes: 5 additions & 2 deletions versioned_docs/version-0.4.3/user_docs/support/faq-kcl.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ schema Person:
We can use the union operator `|` or the dict unpacking operator `**` to add elements into a dict, and we can use `in` and `not in` operators to determine whether the dict variable contains a certain key.

```python
_left = {key = {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -110,9 +110,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

It is also possible to add key-value pair to a dict using the `string interpolation` or the string `format` method.
Expand Down
7 changes: 5 additions & 2 deletions versioned_docs/version-0.4.4/user_docs/support/faq-kcl.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ schema Person:
We can use the union operator `|` or the dict unpacking operator `**` to add elements into a dict, and we can use `in` and `not in` operators to determine whether the dict variable contains a certain key.

```python
_left = {key = {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -110,9 +110,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

It is also possible to add key-value pair to a dict using the `string interpolation` or the string `format` method.
Expand Down
7 changes: 5 additions & 2 deletions versioned_docs/version-0.4.5/user_docs/support/faq-kcl.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ schema Person:
We can use the union operator `|` or the dict unpacking operator `**` to add elements into a dict, and we can use `in` and `not in` operators to determine whether the dict variable contains a certain key.

```python
_left = {key = {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -110,9 +110,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

It is also possible to add key-value pair to a dict using the `string interpolation` or the string `format` method.
Expand Down
7 changes: 5 additions & 2 deletions versioned_docs/version-0.4.6/user_docs/support/faq-kcl.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ schema Person:
We can use the union operator `|` or the dict unpacking operator `**` to add elements into a dict, and we can use `in` and `not in` operators to determine whether the dict variable contains a certain key.

```python
_left = {key = {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -110,9 +110,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

It is also possible to add key-value pair to a dict using the `string interpolation` or the string `format` method.
Expand Down
7 changes: 5 additions & 2 deletions versioned_docs/version-0.5.0/user_docs/support/faq-kcl.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ schema Person:
We can use the union operator `|` or the dict unpacking operator `**` to add elements into a dict, and we can use `in` and `not in` operators to determine whether the dict variable contains a certain key.

```python
_left = {key = {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key = {key2 = "value2"}, intKey = 2}
_left = {key: {key1 = "value1"}, intKey = 1} # Note: `=` denotes override the value.
_right = {key: {key2 = "value2"}, intKey = 2}
dataUnion = _left | _right # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
dataUnpack = {**_left, **_right} # {"key": {"key1": "value1", "key2": "value2"}, "intKey": 2}
```
Expand All @@ -110,9 +110,12 @@ dataUnion:
key:
key1: value1
key2: value2
intKey: 2
dataUnpack:
key:
key1: value1
key2: value2
intKey: 2
```

It is also possible to add key-value pair to a dict using the `string interpolation` or the string `format` method.
Expand Down