Skip to content

Commit f882338

Browse files
K-dashyukinarit
andcommitted
Translate faq.md to Japanese
Co-Authored-By: yukinarit <[email protected]>
1 parent 6e53a66 commit f882338

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docs/ja/faq.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# FAQ
2+
3+
## pyserdeによって生成されたコードをどのように確認できますか?
4+
5+
pyserdeはコマンドラインとして動作する `inspect` サブモジュールを提供しています。
6+
```
7+
python -m serde.inspect <PATH_TO_FILE> <CLASS>
8+
```
9+
10+
例:pyserdeプロジェクト内で以下を実行します。
11+
12+
```
13+
cd pyserde
14+
poetry shell
15+
python -m serde.inspect examples/simple.py Foo
16+
```
17+
18+
出力
19+
```python
20+
Loading simple.Foo from examples.
21+
22+
==================================================
23+
Foo
24+
==================================================
25+
26+
--------------------------------------------------
27+
Functions generated by pyserde
28+
--------------------------------------------------
29+
def to_iter(obj, reuse_instances=True, convert_sets=False):
30+
if reuse_instances is Ellipsis:
31+
reuse_instances = True
32+
if convert_sets is Ellipsis:
33+
convert_sets = False
34+
if not is_dataclass(obj):
35+
return copy.deepcopy(obj)
36+
37+
Foo = serde_scope.types["Foo"]
38+
res = []
39+
res.append(obj.i)
40+
res.append(obj.s)
41+
res.append(obj.f)
42+
res.append(obj.b)
43+
return tuple(res)
44+
...
45+
```

0 commit comments

Comments
 (0)