File: with_pydantic.py

package info (click to toggle)
python-pdoc 16.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,080 kB
  • sloc: python: 5,260; javascript: 1,156; makefile: 18; sh: 3
file content (18 lines) | stat: -rw-r--r-- 333 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""
A small example with Pydantic entities.
"""

import pydantic


class Foo(pydantic.BaseModel):
    """Foo class documentation."""

    model_config = pydantic.ConfigDict(
        use_attribute_docstrings=True,
    )

    a: int = pydantic.Field(default=1, description="Docstring for a")

    b: int = 2
    """Docstring for b."""