Skip to content

Commit

Permalink
Translate faq.md to Japanese
Browse files Browse the repository at this point in the history
Co-Authored-By: yukinarit <[email protected]>
  • Loading branch information
K-dash and yukinarit committed Jun 18, 2024
1 parent 6e53a66 commit f882338
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docs/ja/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# FAQ

## pyserdeによって生成されたコードをどのように確認できますか?

pyserdeはコマンドラインとして動作する `inspect` サブモジュールを提供しています。
```
python -m serde.inspect <PATH_TO_FILE> <CLASS>
```

例:pyserdeプロジェクト内で以下を実行します。

```
cd pyserde
poetry shell
python -m serde.inspect examples/simple.py Foo
```

出力
```python
Loading simple.Foo from examples.

==================================================
Foo
==================================================

--------------------------------------------------
Functions generated by pyserde
--------------------------------------------------
def to_iter(obj, reuse_instances=True, convert_sets=False):
if reuse_instances is Ellipsis:
reuse_instances = True
if convert_sets is Ellipsis:
convert_sets = False
if not is_dataclass(obj):
return copy.deepcopy(obj)

Foo = serde_scope.types["Foo"]
res = []
res.append(obj.i)
res.append(obj.s)
res.append(obj.f)
res.append(obj.b)
return tuple(res)
...
```

0 comments on commit f882338

Please sign in to comment.