Skip to content

Person

Bases: Struct

Class representing a person.

Parameters:

Name Type Description Default
name str

Name of the person.

required
age int

Age in years (description in the field)

0
Source code in src/fieldz_docs_example/msgspec.py
 6
 7
 8
 9
10
11
12
13
14
15
16
class Person(Struct):
    """Class representing a person.

    Parameters
    ----------
    name : str
        Name of the person.
    """

    name: str
    age: Annotated[int, Meta(description="Age in years (description in the field)")] = 0