Files
pydantic/docs/usage/devtools.md
T
Samuel Colvin 17b5ff42c1 renaming docs examples (#972)
* renaming docs examples

* tweaks
2019-11-07 14:40:44 +00:00

764 B

!!! note Admission: I (the primary developer of pydantic) also develop python-devtools.

python-devtools (pip install devtools) provides a number of tools which are useful during python development, including debug() an alternative to print() which formats output in a way which should be easier to read than print as well as giving information about which file/line the print statement is on and what value was printed.

pydantic integrates with devtools by implementing the __pretty__ method on most public classes.

In particular debug() is useful when inspecting models:

{!.tmp_examples/devtools_main.py!}

Will output in your terminal:

{!.tmp_examples/devtools_main.html!}