File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments