Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
fields.cpython-313.pyc733 linesDownload Raw Back to __pycache__
1�

2��jg@�%�F�%SrSSKJr SSKrSSKrSSKrSSKrSSKJ	r	J3r4 SSKJr SSKJr
 SSKJr SSKJrJrJrJrJrJrJrJr SS	KJr SSKrSSKrSS5KJrJr SSKJ r J!r!J"r"J#r#J$r$ SSK%J&r& SS
K'J(r(J)r)J*r*J+r+J,r, SSK-J.r. SSK/J0r0J1r1J2r2J3r3J4r4J5r5J6r6 SSK7J8r8J9r9 SSK:J;r;J<r<J=r= SSK>J?r? SSK@JArAJBrB SSKCJDrD SSKJErE \(aSSKFJGrG SSKHJIrI SrJ\rKS\LS'\R�S:�aSSKr\RH\$-rNS\LS'O\$rNS\LS'"SS \"S!S"9rO"S#S$\OS!S"9rP"S%S&\"S'S(9rQ\"S)S*\4R�55rS"S+S,\"5rT0S-S._S/S_S0S_S1S_S2S_S3S_S4S_S5S_S6S_S7S_S8S_S9S_S:S_S;S_S<S_S=S_S>S_S'SSSS?.ErU0\UESSSSSSSSSSSSSSS@.ErV\"SA5rW\\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\KSB."S]SDjj5r\\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\KSE.!S^SFjj5r\\K\K\K\K\K\K\K\K\K\K\K\K\K\KS.\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\KSB."S_SGjj5r\\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\KSE.!S`SHjj5r\\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\KSB."SaSIjj5r\\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\KSB."SbSJjj5r\4\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\K\KSK.#ScSLjjjr\X"\R�"\5R�5r[\[R�SC5 "SMSN\4R�5r]\S!SO.SdSPjj5r^\S!SO.SeSQjj5r^\S!SO.SfSRjj5r^\4SS!SS.SgSTjjjr^\R�"Sh0\3R�D6"SUSV55raSiSWjrb\"SX5rc\SjSYj5rd\SSSSSSSSSS'\SZ.SkS[jj5rdSlSSSSSSSSSS\SZ.SmS\jjjrdg)nzDefining fields on models.�)�annotationsN)�Callable�Mapping)�copy)�Field)�cached_property)�
TYPE_CHECKING�	Annotated�Any�ClassVar�Literal�TypeVar�final�overload)�warn)�MISSING�PydanticUndefined)�Self�	TypeAlias�	TypedDict�Unpack�6deprecated)�typing_objects)�UNKNOWN�AnnotationSource�ForbiddenQualifier�	Qualifier�inspect_annotation�)�types)�_decorators�_fields�	_generics�_internal_dataclass�_repr�
_typing_extra�_utils)�GlobalsNamespace�MappingNamespace)�AliasChoices�AliasGenerator�	AliasPath)�JsonDict)�PydanticForbiddenQualifier�PydanticUserError)�PydanticJsonSchemaWarning)�PydanticDeprecatedSince20)�
ConfigWrapper)�ReprArgs)r�	FieldInfo�PrivateAttr�computed_fieldr�_Unset)��
r�7Deprecatedc��\rSrSr%SrS\S'S\S'S\S'S	\S8'S\S'S\S
'S\S'S\S'S\S'S\S'S\S'S\S'S\S'S\S'S\S'S\S'S \S!'S\S"'S	\S#'S	\S$'S%\S&'S\S''S	\S('S	\S)'S*\S+'S,\S-'S.\S/'S0\S1'S\S2'S\S3'S4\S5'S\S6'S\S7'S\S8'S\S9'S\S:'S;rg<)=�_FromFieldInfoInputs�2z[This class exists solely to add type checking for the `**kwargs` in `FieldInfo.from_field`.�type[Any] | None�9annotation�:Callable[[], Any] | Callable[[dict[str, Any]], Any] | None�default_factory�10str | None�alias�11int | None�alias_priority�%str | AliasPath | AliasChoices | None�validation_alias�serialization_alias�title�&Callable[[str, FieldInfo], str] | None�field_title_generator�description�list[Any] | None�examples�bool | None�exclude�Callable[[Any], bool] | None�12exclude_if�!annotated_types.SupportsGt | None�gt�!annotated_types.SupportsGe | None�ge�!annotated_types.SupportsLt | None�lt�!annotated_types.SupportsLe | None�le�float | None�multiple_of�strict�13min_length�14max_length�str | re.Pattern[str] | None�pattern�
allow_inf_nan�15max_digits�decimal_placesz(Literal['smart', 'left_to_right'] | None�16union_mode� str | types.Discriminator | None�
discriminator�Deprecated | str | bool | Noner�,JsonDict | Callable[[JsonDict], None] | None�json_schema_extra�frozen�validate_default�bool�repr�init�init_var�kw_only�coerce_numbers_to_str�	fail_fast�N��__name__�17__module__�__qualname__�__firstlineno__�__doc__�__annotations__�__static_attributes__rt��UD:\code\apps\devtools\python\user_packages\Python313\site-packages\pydantic/fields.pyr<r<2s���e�!� �O�O�����;�;�#�#���A�A�����
��,�,�)�)�)�)�)�)�)�)���������
)�)�������8�8�3�3�.�.�C�C���!�!�18�J�19����
��&�&��r}r<F)�totalc�$�\rSrSr%SrS\S'Srg)�_FieldInfoInputs�\zYThis class exists solely to add type checking for the `**kwargs` in `FieldInfo.__init__`.r�defaultrtNrurtr}r~r�r�\s20��c�
�Lr}r�c�4�\rSrSr%S\S'S\S'S\S'Srg	)21�_FieldInfoAsDict�brr?�	list[Any]�metadata�dict[str, Any]�22attributesrtN)rvrwrxryr{r|rtr}r~r�r�bs���O����r}r�T)�closedc���\rSrSr%SrS\S'S\S'S\S'S	\S23'S\S'S
\S'S	\S'S	\S'S\S'S	\S'S\S'S\S'S\S'S\S'S\S'S\S'S\S 'S\S!'S"\S#'S\S$'S\S%'S\S&'S'\S('S)r\R\	R\	R\	R\	R\	R\	R\	R S*S*S*S*S*S*\R"S+.rS,\S-'SJS.jr\\4SKS/jj5r\\R0S0.SLS1jj5r\\R0S0.SMS2jj5r\SNS3j5r\\R<"S4S*S59SOS6j55r\SPS7j5r \SQS8j5r!\"SRS9j5r#\"SSS:j5r$\%S*S;.STS<jj5r&\%S=S>.SUS?jj5r&S@S*SA.SVSBjjr&SWSCjr'SXSDjr(SYSZSEjjr)S[SFjr*S\SGjr+S]SHjr,SIr-g*)^r4�iaThis class holds information about a field.24 25`FieldInfo` is used for any field definition regardless of whether the [`Field()`][pydantic.fields.Field]26function is explicitly used.27 28!!! warning29    The `FieldInfo` class is meant to expose information about a field in a Pydantic model or dataclass.30    `FieldInfo` instances shouldn't be instantiated directly, nor mutated.31 32    If you need to derive a new model from another one and are willing to alter `FieldInfo` instances,33    refer to this [dynamic model example](../examples/dynamic_models.md).34 35Attributes:36    annotation: The type annotation of the field.37    default: The default value of the field.38    default_factory: A callable to generate the default value. The callable can either take 0 arguments39        (in which case it is called as is) or a single argument containing the already validated data.40    alias: The alias name of the field.41    alias_priority: The priority of the field's alias.42    validation_alias: The validation alias of the field.43    serialization_alias: The serialization alias of the field.44    title: The title of the field.45    field_title_generator: A callable that takes a field name and returns title for it.46    description: The description of the field.47    examples: List of examples of the field.48    exclude: Whether to exclude the field from the model serialization.49    exclude_if: A callable that determines whether to exclude a field during serialization based on its value.50    discriminator: Field name or Discriminator for discriminating the type in a tagged union.51    deprecated: A deprecation message, an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport,52        or a boolean. If `True`, a default deprecation message will be emitted when accessing the field.53    json_schema_extra: A dict or callable to provide extra JSON schema properties.54    frozen: Whether the field is frozen.55    validate_default: Whether to validate the default value of the field.56    repr: Whether to include the field in representation of the model.57    init: Whether the field should be included in the constructor of the dataclass.58    init_var: Whether the field should _only_ be included in the constructor of the dataclass, and not stored.59    kw_only: Whether the field should be a keyword-only argument in the constructor of the dataclass.60    metadata: The metadata list. Contains all the data that isn't expressed as direct `FieldInfo` attributes, including:61 62        * Type-specific constraints, such as `gt` or `min_length` (these are converted to metadata classes such as `annotated_types.Gt`).63        * Any other arbitrary object used within [`Annotated`][typing.Annotated] metadata64          (e.g. [custom types handlers](../concepts/types.md#as-an-annotation) or any object not recognized by Pydantic).65r>r?rr�r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrfrgrhrrirjrkrlrmrnrorprqr�r�)r?r�rArCrErGrHrIrKrLrNrPrRrgrrjrkrlrnrorprqr��_attributes_set�_qualifiers�	_complete�_original_assignment�_original_annotation�_finalN)r]rTrVrXrZr\r^r_rarbrcrdrerrrsz0ClassVar[dict[str, Callable[[Any], Any] | None]]�metadata_lookupc��UR5VVs0sH#up#U[LdMX R;dM!X#_M% snnUlUR5VVs0sH%up#X#[La[RU5OU_M' nnnURS5UlURS[5nU[La([Ul66URRSS5 OX@l67URSS5UlUR[LaURb[S5eURSS5Ul
URSS5UlURSS5Ul[!S	URURUR455nU(aURS68S5=(d SOSUlURSS5UlURS
S5UlURSS5UlURSS5UlURSS5UlURSS5UlURSS5UlURS[3USS55UlURSS5UlURSS5UlURSS5UlURSS5UlURSS5UlURSS5Ul URSS5Ul!UREU5Ul#[I5Ul%SUl&[Ul'[Ul(SUl)gs snnfs snnf)z�This class should generally not be initialized directly; instead, use the `pydantic.fields.Field` function69or one of the constructor classmethods.70 71See the signature of `pydantic.fields.Field` for more details about the expected arguments.72r?r�NrA�/cannot specify both default and default_factoryrCrGrHc3�(# �UHoSLv� M73 g7f�Nrt)�.0rCs  r~�	<genexpr>�%FieldInfo.__init__.<locals>.<genexpr>s���x�:w���,�:w�s�rE�rIrKrLrNrPrRrgrrnTrjrlrkrorprqF)*�itemsr7r�r��_DefaultValues�getr?�popr�Ellipsisr�rA�	TypeErrorrCrGrH�anyrErIrKrLrNrPrRrg�getattrrrnrjrlrkrorprq�_collect_metadatar��setr�r�r�r�r�)�self�kwargs�k�vr��alias_is_sets      r~�__init__�FieldInfo.__init__�s���28����u����1�F�?��WX�`t�`t�Wt�����u���MS�\�\�^�\�^�T�Q�!�6�k�^�'�'��*�q�@�^��\� �*�*�\�2����*�*�Y�(9�:���h��,�D�L�� � �$�$�Y��5�"�L�%�z�z�*;�T�B����<�<�0�0�T�5I�5I�5U��M�N�N��Z�Z���.��74� &�75�76�+=�t� D���#)�:�:�.C�T�#J�� ��x�4�:�:�t�G\�G\�^b�^v�^v�:w�x�x��IU�f�j�j�)9�4�@�E�A��[_����Z�Z���.��77�%+�Z�Z�0G��%N��"�!�:�:�m�T�:����78�79�:�t�4��
��z�z�)�T�2��� �*�*�\�4�8���#�Z�Z���>��� �*�*�\�7�4��t�3T�U����J�J�v�t�,��	�!'���,?��!F��� &�80�81�+=�t� D����j�j��4�0����J�J�v�t�,��	��82�83�:�t�4��
��z�z�)�T�2����.�.�v�6��
�,/�5������):��!�):��!�����g v��\s�M=�
M=�M=�,Nc�>�SU;a[S5e[SSU0UD6$)aCreate a new `FieldInfo` object with the `Field` function.84 85Args:86    default: The default value for the field. Defaults to Undefined.87    **kwargs: Additional arguments dictionary.88 89Raises:90    TypeError: If 'annotation' is passed as a keyword argument.91 92Returns:93    A new FieldInfo object with the given parameters.94 95Example:96    This is how you can create a field with default value like this:97 98    ```python99    import pydantic100 101    class MyModel(pydantic.BaseModel):102        foo: int = pydantic.Field(4)103    ```104r?z9"annotation" is not permitted as a Field keyword argumentr�rt)r�r4)r�r�s  r~�105from_field�FieldInfo.from_field"s+��0�6�!��W�X�X��3��3�F�3�3r})�_sourcec�l�[UUSS9nUR[106La[OURnSUR;nURnSU0nU(aSUS'[R"U40UD6nURUlSUlU$![an[URU5eSnAff=f)a�Creates a `FieldInfo` instance from a bare annotation.107 108This function is used internally to create a `FieldInfo` from a bare annotation like this:109 110```python111import pydantic112 113class MyModel(pydantic.BaseModel):114    foo: int  # <-- like this115```116 117We also account for the case where the annotation can be an instance of `Annotated` and where118one of the (not first) arguments in `Annotated` is an instance of `FieldInfo`, e.g.:119 120```python121from typing import Annotated122 123import annotated_types124 125import pydantic126 127class MyModel(pydantic.BaseModel):128    foo: Annotated[int, annotated_types.Gt(42)]129    bar: Annotated[int, pydantic.Field(gt=42)]130```131 132Args:133    annotation: An annotation object.134 135Returns:136    An instance of the field metadata.137�skip��annotation_source�unpack_type_aliasesNrr?Trk)
rrr.�	qualifier�typerr�138qualifiersr�r4�139_constructr�r�)	r?r��
inspected_ann�e�	type_exprrr��attr_overrides�140field_infos	         r~�from_annotation�FieldInfo.from_annotation>s���D	F�.��")�$*��M�!.� 2� 2�g� =��=�CU�CU�	��=�3�3�3�� �)�)��&�	�2���'+�N�8�$��)�)�(�E�n�E�141�!.�!9�!9�142�� �143�����%"�	F�,�Q�[�[�*�E�E��	F�s�B�144B3�B.�.B3c�p�U[LaXLa145[SSS9e[UUSS9nUR[La[OURnSUR;nURnSnSU0n	U(aS	U	S146'U(dy[U[5(ad[
U5[LaRUR5n147U148RRU	5 U	R!5Hup�[#X�U5 M U149$[U[5(a>UR5n
U
Rn/U
l150X}/-nSUR;aS	U	S'O�[U[$R&5(al[R)U5nURn/Ul151X~/-nSUR;aS	U	S'[+USS5=nbX�S'[+US
S5=nbUU	S
'OXS'[R,"UbX�-OU40U	D6n152URU153lS	U154lU155$![an[	UR156U5eSnAff=f)a!Create `FieldInfo` from an annotation with a default value.157 158This is used in cases like the following:159 160```python161from typing import Annotated162 163import annotated_types164 165import pydantic166 167class MyModel(pydantic.BaseModel):168    foo: int = 4  # <-- like this169    bar: Annotated[int, annotated_types.Gt(4)] = 4  # <-- or this170    spam: Annotated[int, pydantic.Field(gt=4)] = 4  # <-- or this171```172 173Args:174    annotation: The type annotation of the field.175    default: The default value of the field.176 177Returns:178    A field object with the passed values.179z�Error when building FieldInfo from annotated attribute. Make sure you don't have any field name clashing with a type annotation.zunevaluable-type-annotation��coder�r�Nrr?Trkrprorqr�)rr/rrr.r�r�rrr�r��180isinstancer4�_copyr��updater��setattr�dataclassesr�_from_dataclass_fieldr�r�r�r�)r?r�r�r�r�r�rr��prepend_metadatar�r�r�r��default_copyr�rorqs                 r~�from_annotated_attribute�"FieldInfo.from_annotated_attributezsP��8�W�$��)>�#�[�2��
�	F�.��")�$*��M�!.� 2� 2�g� =��=�CU�CU�	��=�3�3�3�� �)�)��181.2��&�	�2���'+�N�8�$�182�J�w�	�:�:�t�G�}�T]�?]� ����J��&�&�-�-�n�=�&�,�,�.����183�q�)�/����g�y�)�)�"�=�=�?�L�+�4�4��$&�L�!��.�0�H��]�5�5�5�.2��z�*��
���!2�!2�
3�
3�"�8�8��A�J�)�2�2��"$�J���,�.�H��]�5�5�5�-1��z�*�����6�6��C�)-�v�&�"�7�I�t�<�<��I�,3��y�)��)0�9�%��)�)�+;�+G��'�X�184�Yg�185�186�"/�!9�!9�187�� �188�����u"�	F�,�Q�[�[�*�E�E��	F�s�H�189H5�H0�0H5c�L�/n0nUGHtn[U[5(Ga'URUR5 SnURnUb�SU;a�USn[U[1905(a=[U[1915(a0UEUEnOV[
U5(a[S[5 O5[
U5(a%[U[1925(a[S[5 UR(a0UR[V	s0sHo�[XY5_M sn	5 OURUR5 UbXdS'GM>GMA[R"U5(aXTS'GMcUR!U5 GMw URU5 U"S0UD6n193X:lU194$s sn	f)a2Construct the final `FieldInfo` instance, by merging the possibly existing `FieldInfo` instances from the metadata.195 196With the following example:197 198```python {test="skip" lint="skip"}199class Model(BaseModel):200    f: Annotated[int, Gt(1), Field(description='desc', lt=2)]201```202 203`metadata` refers to the metadata elements of the `Annotated` form. This metadata is iterated over from left to right:204 205- If the element is a `Field()` function (which is itself a `FieldInfo` instance), the field attributes (such as206  `description`) are saved to be set on the final `FieldInfo` instance.207  On the other hand, some kwargs (such as `lt`) are stored as `metadata` (see `FieldInfo.__init__()`, calling208  `FieldInfo._collect_metadata()`). In this case, the final metadata list is extended with the one from this instance.209- Else, the element is considered as a single metadata object, and is appended to the final metadata list.210 211Args:212    metadata: The list of metadata elements to merge together. If the `FieldInfo` instance to be constructed is for213        a field with an assigned `Field()`, this `Field()` assignment should be added as the last element of the214        provided metadata.215    **attr_overrides: Extra attributes that should be set on the final merged `FieldInfo` instance.216 217Returns:218    The final merged `FieldInfo` instance.219Nrjz�Composing `dict` and `callable` type `json_schema_extra` is not supported. The `callable` type is being ignored. If you'd like support for this behavior, please open an issue on pydantic.rrt)r�r4�extendr�rj�dict�callabler�UserWarningr�r��_Attrsr�r�r�
is_deprecated�append)�clsr�r��merged_metadata�
merged_kwargs�meta�new_js_extra�current_js_extra�existing_js_extra�attr�merged_field_infos           r~r��FieldInfo._construct�s���8&(��(*�
��D��$�	�*�*��&�&�t�}�}�5�04��#'�#9�#9� �#�/�4G�=�4X�(5�6I�(J�%�!�"3�T�:�:�%�&6��=�=�,�"3�,�"2�,�L�&�&6�7�7� �!m�!,�	��"�"3�4�4��DT�VZ�9[�9[��i�(�	�*�;�;�!�(�(�PV�)W�PV����0C�*C�PV�)W�X�!�(�(��)=�)=�>��+�9E�"5�6�,��-�-�d�3�3�.2�l�+��&�&�t�,�m�p	���^�,��0�-�0��%4�"� � ��*Xs�F!220z�The 'merge_field_infos()' method is deprecated and will be removed in a future version. If you relied on this method, please open an issue in the Pydantic issue tracker.)�categoryc���[U5S:Xa�USR5nURRU5 UR	S[2215nU[La[222nU[223LaX2lUR5HupE[X$U5 M U$0n0nUH�nURR5nUR	S5n	URS5n224U225cX�S'[U226[5(a?[U	[5(a	0U227EU	EUS'[U	5(a[S[ 5 O[U	5(aX�S'URU5 UR$H'n[U[&5(aMX�[)U5'M) M� URU5 ['S0UD6n[+UR-55UlU$!["a N�f=f)z�Merge `FieldInfo` instances keeping only explicitly set attributes.228 229Later `FieldInfo` instances override earlier ones.230 231Returns:232    FieldInfo: A merged FieldInfo instance.233rrr�rjz�Composing `dict` and `callable` type `json_schema_extra` is not supported.The `callable` type is being ignored.If you'd like support for this behavior, please open an issue on pydantic.rt)�lenr�r�r�r�rr�r�r�r�rr�r�r�r�rr0�KeyErrorr�r4r��list�values)�field_infos�	overridesr��default_overrider�r��merged_field_info_kwargsr��attributes_setrj�existing_json_schema_extra�xs            r~�merge_field_infos�FieldInfo.merge_field_infos;s����{��q� �$�Q��-�-�/�J��&�&�-�-�i�8�(�}�}�Y�8I�J���8�+�#4� ��'8�8�%5�"�!���)����234�q�)�*���35� ���%�J�'�7�7�<�<�>�N�
�$2�$6�$6�7J�$K�!�-E�-I�-I�J]�-^�*�-�5�DU�-@�A��8�$�?�?�!�"3�T�:�:�I�8�I�/�I�0�1D�E� � 1�2�2��i�6�	���/�0�0�DU�-@�A�235
%�+�+�N�;��(�(��!�!�Y�/�/�()�T�!�W�%�)�?&�F	!�'�'�	�2��:�!9�:�236�"�8�?�?�#4�5�237������
��
�s�=A<G�:G�238G#�"G#c��URnU[RLa[nUR[RLa[nOURnUR239R
5VVs0sHup4U[;dMX4_M nnn[RS:�aURbURUS'[SXURS.UD6$s snnf)a%Return a new `FieldInfo` instance from a `dataclasses.Field` instance.240 241Args:242    dc_field: The `dataclasses.Field` instance to convert.243 244Returns:245    The corresponding `FieldInfo` instance.246 247Raises:248    TypeError: If any of the `FieldInfo` kwargs does not match the `dataclass.Field` kwargs.249)r8�rL)r�rArnrt)
r�r�rr7rAr�r��_FIELD_ARG_NAMES�sys�version_info�docrrn)�dc_fieldr�rAr�r��dc_field_metadatas      r~r��FieldInfo._from_dataclass_field�s����"�"���k�)�)�)��G��#�#�{�':�':�:�$�O�&�6�6�O�/7�.?�.?�.E�.E�.G�a�.G�d�a�1�P`�K`�T�Q�T�.G��a����w�&�8�<�<�+C�/7�|�|��m�,��o�W�H�M�M�o�]n�o�o��bs�3C�Cc�B�/n0n[UR55H@up4[RUnX	UcM UcXBU'M)URU"U55 MB U(a%UR[R"S0UD65 U$![a Mf=f)z�Collect annotations from kwargs.250 251Args:252    kwargs: Keyword arguments passed to the function.253 254Returns:255    A list of metadata objects - a combination of `annotated_types.BaseMetadata` and256        `PydanticMetadata`.257rt)r�r�r4r�r�r�r"�pydantic_general_metadata)r�r��general_metadata�key�value�markers      r~r��FieldInfo._collect_metadata�s���!�����v�|�|�~�.�J�C�
�"�2�2�3�7����� ��>�,1�S�)��O�O�F�5�M�2�/���O�O�G�=�=�Q�@P�Q�R�����
��
�s�B�258B�Bc��URcg[UR[5(aUR(aS$S$[UR[5(aUR$URR$�z<The deprecation message to be emitted, or `None` if not set.Nr�rr�rm�str�message�r�s r~�deprecation_message�FieldInfo.deprecation_message��\���?�?�"���d�o�o�t�,�,�#'�?�?�<�<��<�",�T�_�_�c�"B�"B�t���_����H_�H_�_r}c�^�URb [R"UR5$g�z|Whether the provided default factory callable has a validated data parameter.259 260Returns `None` if no default factory is set.261N�rAr"�takes_validated_data_argumentrs r~�$default_factory_takes_validated_data�.FieldInfo.default_factory_takes_validated_data��,�����+��8�8��9M�9M�N�N�,r}��validated_datac��gr�rt�r��call_default_factoryrs   r~�get_default�FieldInfo.get_default����r}.�rc��gr�rt�r�rs  r~rr����QTr}F�rrc�X�[R"URURUUS9$)a%Get the default value.262 263We expose an option for whether to call the default_factory (if present), as calling it may264result in side effects that we want to avoid. However, there are times when it really should265be called (namely, when instantiating a model via `model_construct`).266 267Args:268    call_default_factory: Whether to call the default factory or not.269    validated_data: The already validated data to be passed to the default factory.270 271Returns:272    The default value, calling the default factory if requested or `PydanticUndefined` if not set.273�r�rArr�r"�resolve_default_valuer�rArs   r~rr��-���,�,��L�L� �0�0�)�!5�	274�	275r}c�P�UR[L=(a URSL$)z�Check if the field is required (i.e., does not have a default value or factory).276 277Returns:278    `True` if the field is required, `False` otherwise.279N)r�rrArs r~�is_required�FieldInfo.is_required�s$���|�|�0�0�Q�T�5I�5I�T�5Q�Qr}c�~�UR(dUR$[UR/URQ7$)a�Attempts to rebuild the original annotation for use in function signatures.280 281If metadata is present, it adds it to the original annotation using282`Annotated`. Otherwise, it returns the original annotation as-is.283 284Note that because the metadata has been flattened, the original annotation285may not be reconstructed exactly as originally provided, e.g. if the original286type had unrecognized annotations, or was annotated with a call to `pydantic.Field`.287 288Returns:289    The rebuilt annotation.290)r�r?r291rs r~�rebuild_annotation�FieldInfo.rebuild_annotation�s2���}�}��?�?�"��d�o�o�>��
�
�>�?�?r}c���[R"URU5n[R"XBU5upEX@lU(dSUlURUlgg)aLApply a `typevars_map` to the annotation.292 293This method is used when analyzing parametrized generic types to replace typevars with their concrete types.294 295This method applies the `typevars_map` to the annotation in place.296 297Args:298    typevars_map: A dictionary mapping type variables to their concrete types.299    globalns: The globals namespace to use during type annotation evaluation.300    localns: The locals namespace to use during type annotation evaluation.301 302See Also:303    pydantic._internal._generics.replace_types is used for replacing the typevars with304        their concrete types.305FN)r#�
replace_typesr?r&�
try_eval_typer�r�)r��typevars_map�globalns�localnsr?�	evaluateds      r~�apply_typevars_map�FieldInfo.apply_typevars_mapsP��*�,�,�T�_�_�l�K�306� -� ;� ;�J�RY� Z��307�$���"�D�N�(,���D�%�r}c308�|�URUR[Vs0sHo[X5_M snS.$s snf)a5Return a dictionary representation of the `FieldInfo` instance.309 310The returned value is a dictionary with three items:311 312* `annotation`: The type annotation of the field.313* `metadata`: The metadata list.314* `attributes`: A mapping of the remaining `FieldInfo` attributes to their values (e.g. `alias`, `title`).315)r?r�r�)r?r�r�r�)r�r�s  r~�asdict�FieldInfo.asdict!s<���/�/��
�
�AG�H�����!4�4��H�316�	317��Is�9c	�$�[U5[LaF[R[5n[RHn[	X[X55 M O[
U5nSH&n[	X[X5R
55 M( U$)z*Return a copy of the `FieldInfo` instance.)r�r�r�)r�r4�__new__�	__slots__r�r�r)r��copied�	attr_names   r~r��FieldInfo._copy0st��318��:��"��&�&�y�1�F�&�0�0�	���7�4�+C�D�1��$�Z�F�G�I��F�w�v�'A�'F�'F�'H�I�H��
r}c#�*# �S[R"[R"UR554v� SUR	54v� UR319GH2nUS;aMUS:XaUR(dM%US:XaURSLaM<US:XaURSLaMSUS	:XaURUR:XaMuUS320:XaURUR:XaM�US:Xa%UR[LaSUR4v� M�US:XaHURb;S[R"[R"UR554v� GM[X5nUcGM!U[LdGM-X4v� GM5 g7f)
Nr?�required)r?r�r�r�r�r�r�r�rnTrkFrGrHr�rA)r%�	PlainRepr�display_as_typer?r#r6r�rnrkrGrCrHr�rrAr�)r��sr�s   r~�
__repr_args__�FieldInfo.__repr_args__CsL����E�O�O�E�,A�,A�$�/�/�,R�S�S�S��$�*�*�,�,�,����A������j�������f�����d�!2���H�}�����!5���&�&�4�+@�+@�D�J�J�+N���)�)�d�.F�.F�$�*�*�.T���I�~�$�,�,�6G�"G�����-�-��'�'�D�,@�,@�,L�'�����9N�9N�t�Oc�Oc�9d�)e�e�e���(���$��6G�)G��(�N�= �s�E5F�<F�F)r�r�r�r�r�r�rCrEr?r�rArrLrgrNrPrRrKrkrorprjrqr�rnrHrIrlrG)r�zUnpack[_FieldInfoInputs]�return�None)r�rr�zUnpack[_FromFieldInfoInputs]rAr4)r?�	type[Any]r�rrAr4)r?rCr�rr�rrAr4)r�r�r�rrAr)r�r4r�rrAr4)r�zDataclassField[Any]rAr4)r�r�rAr��rArB�rArO�r�
Literal[True]r�dict[str, Any] | NonerAr�r�Literal[False]rAr�rrmrrHrAr)rArm)rAr)NN)r+zMapping[TypeVar, Any] | Noner,zGlobalsNamespace | Noner-zMappingNamespace | NonerArB)rAr��rAr)rAr3).rvrwrxryrzr{r6r �Strict�annotated_types�Gt�Ge�Lt�Le�321MultipleOf�MinLen�MaxLen�FailFastr�r��staticmethodrr�r�ANYr�r��classmethodr��typing_extensionsrr�r�r��propertyrr
rrr#r&r/r2r�r?r|rtr}r~r4r4is���*�Z!� �
�L�O�O�����;�;�#�#���A�A�����
��,�,�3�3�.�.�C�C���!�!�322�J�323����
�����I�F�,�,�� � �� � �� � �� � �&�1�1�%�,�,�%�,�,������!%��^�^�I�O�E��$<�|�"3�4��4�6�N^�Nb�Nb�9��9�v�L\�L`�L`�b��b�(+�b�9I�b�	�b��b�H�Y!��Y!�v��!�!�	\���324?���?�B�p��p�6����8�`��`��O��O��^b��'4��F[��	�����DG�T��T�:?�im�325�*R�@�,-1�+/�	8�2�8�*�8�)�	8�326327�8�8
328��&"#r}r4c��\rSrSrSrSrg)�_EmptyKwargsihz_This class exists solely to ensure that type checking warns about passing `**extra` in `Field`.rtN)rvrwrxryrzr|rtr}r~r]r]hs��ir}r]r�.rArCrErGrHrIrKrLrNrPrRrgrrjrkrl)rnrorprq)rqrar]rTrVrXrZr\rbrcrdr^r_rr�_T)"rCrErGrHrIrKrLrNrPrRrgrrjrkrlrnrorprqrar]rrrTrVrXrZr\rbrcrdr^r_rers�extrac"��gr�rt�$r�rCrErGrHrIrKrLrNrPrRrgrrjrkrlrnrorprqrar]rrrTrVrXrZr\rbrcrdr^r_rersr_s$                                    r~rr����Nr})!rCrErGrHrIrKrLrNrPrRrgrrjrkrnrorprqrar]rrrTrVrXrZr\rbrcrdr^r_rersc"��gr�rtras$                                    r~rr�rbr}c"��gr�rtras$                                    r~rr����T329
r}c#��gr�rt�$rArCrErGrHrIrKrLrNrPrRrgrrjrkrlrnrorprqrar]rrrTrVrXrZr\rbrcrdr^r_rersr_s$                                    r~rrrbr}c#��gr�rtrgs$                                    r~rr?rer}c"��gr�rt)#rCrErGrHrIrKrLrNrPrRrgrrjrkrlrnrorprqrar]rrrTrVrXrZr\rbrcrdr^r_rersr_s#                                   r~rrjs��Lr})#rArCrErGrHrIrKrLrNrPrRrgrrjrkrlrnrorprqrar]rrrTrVrXrZr\rbrcrdr^r_rersc#��U$RSS5n%U%b330[SSS9eU$RSS5n&U&b[S[SS	9 U S[4;aU&n U$RS331S5n'U'b[S[SS	9 U!S[4;aU'n!U$RSS5n(U(b332[S
SS9eU$RSS5n)U)b[S[SS	9 U)SLaSnU$RSS5n*U*b333[SSS9eU$(aI[SSRSU$R
555S3[SS	9 U(a	U[LaU$nU(a4U[La+[U[[[45(d[S5eU[S4;a[U[5(aUnU[S4;aUnU$RSS5n+U+b[S[SS	9 [R"U40SU_SU_SU_SU_SU_S U_S!U_S"U_S#U	_S$U334_S%U_S&U_S'U
_S(U_S)U_S*U_S+U_S,U_S-U_S.U_S/U_S0U_S1U_S2U_S3U_S4U_S5U_S6U_S7U _S8U!_S9U_S:U_S;U_S<U"_S=U#_6$)>a�!!! abstract "Usage Documentation"335    [Fields](../concepts/fields.md)336 337Create a field for objects that can be configured.338 339Used to provide extra information about a field, either for the model schema or complex validation. Some arguments340apply only to number fields (`int`, `float`, `Decimal`) and some apply only to `str`.341 342Note:343    - Any `_Unset` objects will be replaced by the corresponding value defined in the `_DefaultValues` dictionary. If a key for the `_Unset` object is not found in the `_DefaultValues` dictionary, it will default to `None`344 345Args:346    default: Default value if the field is not set.347    default_factory: A callable to generate the default value. The callable can either take 0 arguments348        (in which case it is called as is) or a single argument containing the already validated data.349    alias: The name to use for the attribute when validating or serializing by alias.350        This is often used for things like converting between snake and camel case.351    alias_priority: Priority of the alias. This affects whether an alias generator is used.352    validation_alias: Like `alias`, but only affects validation, not serialization.353    serialization_alias: Like `alias`, but only affects serialization, not validation.354    title: Human-readable title.355    field_title_generator: A callable that takes a field name and returns title for it.356    description: Human-readable description.357    examples: Example values for this field.358    exclude: Whether to exclude the field from the model serialization.359    exclude_if: A callable that determines whether to exclude a field during serialization based on its value.360    discriminator: Field name or Discriminator for discriminating the type in a tagged union.361    deprecated: A deprecation message, an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport,362        or a boolean. If `True`, a default deprecation message will be emitted when accessing the field.363    json_schema_extra: A dict or callable to provide extra JSON schema properties.364    frozen: Whether the field is frozen. If true, attempts to change the value on an instance will raise an error.365    validate_default: If `True`, apply validation to the default value every time you create an instance.366        Otherwise, for performance reasons, the default value of the field is trusted and not validated.367    repr: A boolean indicating whether to include the field in the `__repr__` output.368    init: Whether the field should be included in the constructor of the dataclass.369        (Only applies to dataclasses.)370    init_var: Whether the field should _only_ be included in the constructor of the dataclass.371        (Only applies to dataclasses.)372    kw_only: Whether the field should be a keyword-only argument in the constructor of the dataclass.373        (Only applies to dataclasses.)374    coerce_numbers_to_str: Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode).375    strict: If `True`, strict validation is applied to the field.376        See [Strict Mode](../concepts/strict_mode.md) for details.377    gt: Greater than. If set, value must be greater than this. Only applicable to numbers.378    ge: Greater than or equal. If set, value must be greater than or equal to this. Only applicable to numbers.379    lt: Less than. If set, value must be less than this. Only applicable to numbers.380    le: Less than or equal. If set, value must be less than or equal to this. Only applicable to numbers.381    multiple_of: Value must be a multiple of this. Only applicable to numbers.382    min_length: Minimum length for iterables.383    max_length: Maximum length for iterables.384    pattern: Pattern for strings (a regular expression).385    allow_inf_nan: Allow `inf`, `-inf`, `nan`. Only applicable to float and [`Decimal`][decimal.Decimal] numbers.386    max_digits: Maximum number of allow digits for strings.387    decimal_places: Maximum number of decimal places allowed for numbers.388    union_mode: The strategy to apply when validating a union. Can be `smart` (the default), or `left_to_right`.389        See [Union Mode](../concepts/unions.md#union-modes) for details.390    fail_fast: If `True`, validation will stop on the first error. If `False`, all validation errors will be collected.391        This option can be applied only to iterable types (list, tuple, set, and frozenset).392    extra: (Deprecated) Extra fields that will be included in the JSON schema.393 394        !!! warning Deprecated395            The `extra` kwargs is deprecated. Use `json_schema_extra` instead.396 397Returns:398    A new [`FieldInfo`][pydantic.fields.FieldInfo]. The return annotation is `Any` so `Field` can be used on399        type-annotated fields without causing a type error.400�constNz)`const` is removed, use `Literal` insteadzremoved-kwargsr��	min_itemszG`min_items` is deprecated and will be removed, use `min_length` insteadr�)�401stacklevel�	max_itemszG`max_items` is deprecated and will be removed, use `max_length` instead�unique_itemsz`unique_items` is removed, use `Set` instead(this feature is discussed in https://github.com/pydantic/pydantic-core/issues/296)�allow_mutationzH`allow_mutation` is deprecated and will be removed. use `frozen` insteadFT�regexz)`regex` is removed. use `pattern` insteadzzUsing extra keyword arguments on `Field` is deprecated and will be removed. Use `json_schema_extra` instead. (Extra keys: z, c3�@# �UHoR5v� M g7fr�)�__repr__)r�r�s  r~r��Field.<locals>.<genexpr>1s���&J�\��z�z�|�|�\�s��)zSInvalid `validation_alias` type. it should be `str`, `AliasChoices`, or `AliasPath`�includezS`include` is deprecated and does nothing. It will be removed, use `exclude` insteadrArCrErGrHrIrKrLrNrPrRrgrrjrkrarlrnrorprqrrr]rTrVrXrZr\r^r_rbrcrdrers)r�r/rr1r7�join�keysr�rr*r,r�r4r�),r�rArCrErGrHrIrKrLrNrPrRrgrrjrkrlrnrorprqrar]rrrTrVrXrZr\rbrcrdr^r_rersr_rkrlrnrorprqrvs,                                            r~rr�s{��X
�I�I�g�t�$�E���� K�Rb�c�c��	�	�+�t�,�I����U�%��	402�403�$���'�"�J��	�	�+�t�,�I����U�%��	404�405�$���'�"�J��9�9�^�T�2�L����f�"�406�	407��Y�Y�/��6�N��!��V�%��	408�409�U�"��F��I�I�g�t�$�E���� K�Rb�c�c���
�!�Y�Y�&J�U�Z�Z�\�&J�J�K�1�
N�
&��	410�!�$5��$?� %��	��F�*��+�c�<��-K�L�L��m�n�n��v�t�n�,��E�3�1G�1G�#���F�D�>�)� ���i�i�	�4�(�G����a�%��	411�����%�'�%��%�&�	%�412*�%�0�
%��%�4�%� �%��%��%��%�$�%��%�,�%� �!%�"�#%�$*�%%�&�'%�(�)%�*�+%�,�-%�.4�/%�0�1%�2�3%�4�5%�6�7%�8�9%�: �;%�<�=%�>�?%�@$�A%�B�C%�D&�E%�F�G%�H�I%�%r}c���\rSrSrSrSr\4SS.SSjjjr\(dSSjr	SSjr413\SS	j5r\
SS414.SSjj5r\
SS
.SSjj5rSSS.SSjjrSSjrSrg)�ModelPrivateAttriyafA descriptor for private attributes in class models.415 416!!! warning417    You generally shouldn't be creating `ModelPrivateAttr` instances directly, instead use418    `pydantic.fields.PrivateAttr`. (This is similar to `FieldInfo` vs. `Field`.)419 420Attributes:421    default: The default value of the attribute if not provided.422    default_factory: A callable to generate the default value. The callable can either take 0 arguments423        (in which case it is called as is) or a single argument containing the validated data (the model's424        [`__dict__`][object.__dict__]) and the already initialized private attributes.425)r�rAN�rAc�F�U[La[UlOXlX lgr�)r�rr�rA)r�r�rAs   r~r��ModelPrivateAttr.__init__�s���h��,�D�L�"�L�.�r}c��US;a1[URU5(a[URU5$[[	U5R426<SU<35e)z�This function improves compatibility with custom descriptors by ensuring delegation happens427as expected when the default value of a private attribute is a descriptor.428>�__get__�__set__�429__delete__z object has no attribute )�hasattrr�r��AttributeErrorr�rv)r��items  r~�__getattr__�ModelPrivateAttr.__getattr__�sS���;�;��4�<�<��.�.�"�4�<�<��6�6� �D��J�$7�$7�#:�:S�TX�S[�!\�]�]r}c�|�URnU[Lag[USS5n[U5(a	U"X5 gg)zMPreserve `__set_name__` protocol defined in https://peps.python.org/pep-0487.N�__set_name__)r�rr�r�)r�r��namer��set_names     r~r��ModelPrivateAttr.__set_name__�s=���,�,���'�'���7�N�D�9���H����S��r}c�^�URb [R"UR5$gr430rrs r~r
�5ModelPrivateAttr.default_factory_takes_validated_data�rr}rc��gr�rtrs   r~r�ModelPrivateAttr.get_default�rr}.rc��gr�rtrs  r~rr��rr}Frc�X�[R"URURUUS9$)aGet the default value.431 432We expose an option for whether to call the default_factory (if present), as calling it may433result in side effects that we want to avoid. However, there are times when it really should434be called (namely, when instantiating a model via `model_construct`).435 436Args:437    call_default_factory: Whether to call the default factory or not.438    validated_data: The already validated data to be passed to the default factory.439 440Returns:441    The default value, calling the default factory if requested or `None` if not set.442rrrs   r~rr��r!r}c��[XR5=(a1 URUR4URUR4:H$r�)r��	__class__r�rA)r��others  r~�__eq__�ModelPrivateAttr.__eq__�sD���%���0�443�d�l�l�D�DX�DX�5Y��M�M��!�!�^444�6445�	446r})r�rrAr@rArB)r�rrAr)r�rCr�rrArBrErFrIrK)r�rrArm)rvrwrxryrzr6rr�r	r�r�r[r
rrr�r|rtr}r~rzrzys����/�I�)�447/�W[�	448/��449/�T�	450/�451452�453/��	^� ��O��O��^b��'4��F[��	�����DG�T��T�:?�im�454�*455r}rz�roc��gr�rt)r�ros  r~r5r5����456457
r}c��gr�rt�rAros  r~r5r5�r�r}c��gr�rtr�s r~r5r5�s��r}r�c�D�U[LaUb[S5e[UUS9$)as!!! abstract "Usage Documentation"458    [Private Model Attributes](../concepts/models.md#private-model-attributes)459 460Indicates that an attribute is intended for private use and not handled during normal validation/serialization.461 462Private attributes are not validated by Pydantic, so it's up to you to ensure they are used in a type-safe manner.463 464Private attributes are stored in `__private_attributes__` on the model.465 466Args:467    default: The attribute's default value. Defaults to Undefined.468    default_factory: A callable to generate the default value. The callable can either take 0 arguments469        (in which case it is called as is) or a single argument containing the validated data (the model's470        [`__dict__`][object.__dict__]) and the already initialized private attributes.471        If both `default` and `default_factory` are set, an error will be raised.472    init: Whether the attribute should be included in the constructor of the dataclass. Always `False`.473 474Returns:475    An instance of [`ModelPrivateAttr`][pydantic.fields.ModelPrivateAttr] class.476 477Raises:478    ValueError: If both `default` and `default_factory` are set.479r�r{)rr�rz)r�rAros   r~r5r5�s1��:�'�'�O�,G��I�J�J���'��r}c���\rSrSr%SrSrS\S'S\S'S\S	'S480\S'S\S
'S\S'S481\S'S\S'S482\S'S\S'S\S'S\S'S\S'S"Sjr\S#Sj5r	S$Sjr483S%SjrS rg!)&�ComputedFieldInfoia�A container for data from `@computed_field` so that we can access it while building the pydantic-core schema.484 485Attributes:486    decorator_repr: A class variable representing the decorator string, '@computed_field'.487    wrapped_property: The wrapped computed field property.488    return_type: The type of the computed field property's return value.489    alias: The alias of the property to be used during serialization.490    alias_priority: The priority of the alias. This affects whether an alias generator is used.491    title: Title of the computed field to include in the serialization JSON schema.492    field_title_generator: A callable that takes a field name and returns title for it.493    description: Description of the computed field to include in the serialization JSON schema.494    deprecated: A deprecation message, an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport,495        or a boolean. If `True`, a default deprecation message will be emitted when accessing the field.496    examples: Example values of the computed field to include in the serialization JSON schema.497    json_schema_extra: A dict or callable to provide extra JSON schema properties.498    repr: A boolean indicating whether to include the field in the __repr__ output.499z@computed_fieldz
ClassVar[str]�decorator_reprr[�wrapped_propertyr�return_typerBrCrDrErQrRrI�.Callable[[str, ComputedFieldInfo], str] | NonerKrLrhrrMrNrirjrmrnc�500�[U5"URURURURUR501URURURUR[UR[5(aURR5OUR[UR[5(aURR5OURUR S9$)N)r�r�rCrErRrIrKrLrrNrjrn)r�r�r�rCrErRrIrKrLrr�rNr�rrjr�rnrs r~�__copy__�ComputedFieldInfo.__copy__3s����D�z�!�2�2��(�(��*�*��.�.�����*�*�"&�"<�"<��(�(����-7��
�
�t�-L�-L�T�]�]�'�'�)�RV�R_�R_��$�0�0�$�7�7�#�4�4�9�9�;��'�'����502�	503r}c��URcg[UR[5(aUR(aS$S$[UR[5(aUR$URR$rrrs r~r�%ComputedFieldInfo.deprecation_messageErr}c���UR=(d URnUbURc
U"X 5UlURbURURU5 gg)z[Update the instance from the configuration set on the class this computed field belongs to.N)rKrI�alias_generator�_apply_alias_generator)r��config_wrapperr��title_generators    r~�_update_from_config�%ComputedFieldInfo._update_from_configNsZ���4�4�\��8\�8\���&�4�:�:�+=�(��4�D�J��)�)�5��'�'��(F�(F��M�6r}c��URbURS::d
URc�Sup4n[U[5(aUR	U5up4nO[U5(aU"U5nURbURS::aSUlURS:Xa[R"XS5Ulggg)z�Apply an alias generator to aliases if appropriate.504 505Args:506    alias_generator: A callable that takes a string and returns a string, or an `AliasGenerator` instance.507    name: The name of the computed field from which to generate the alias.508Nr)NNN)rErCr�r+�generate_aliasesr�r'�get_first_not_none)r�r�r�rC�_rHs      r~r��(ComputedFieldInfo._apply_alias_generatorVs������&�$�*=�*=��*B�d�j�j�FX�,<�)�E�)��/�>�:�:�0?�0P�0P�QU�0V�-��-��/�*�*�'��-��509�"�"�*�d�.A�.A�Q�.F�&'��#�510�"�"�a�'�#�6�6�7J�R��511�(�#GYr})rCrErINrLrD)r�r2r�rrArB)r�z%Callable[[str], str] | AliasGeneratorr�rrArB)
rvrwrxryrzr�r{r�r[rr�r�r|rtr}r~r�r�s����$%6�N�M�5���������,�,���I�I���.�.���C�C�512�J�513�$�`��`�N�Sr}r�c��Sn[U[5(a[URSS5nO,[U[5(a[UR514SS5nUR
S5=(a UR
S5(+$)z>Returns true if provided property is private, False otherwise.�rvr��__)r�r[r��fgetr�func�515startswith)�	property_�wrapped_names  r~�_wrapped_property_is_privater�vsi���L��)�X�&�&��y�~�~�z�2�>��	�I��	/�	/��y�~�~�z�2�>���"�"�3�'�M��0G�0G��0M�,M�Mr}�	PropertyTc��gr�rt)r�s r~r6r6�s��58r}�rCrErRrIrKrLrrNrjrnr�c��gr�rtr�s           r~r6r6�s��(+r}c�V^^^^^^^^^	^516^�SUUUUUUUU	U517UU4SjjnUcU$U"U5$)ap!!! abstract "Usage Documentation"518    [The `computed_field` decorator](../concepts/fields.md#the-computed_field-decorator)519 520Decorator to include `property` and `cached_property` when serializing models or dataclasses.521 522This is useful for fields that are computed from other fields, or for fields that are expensive to compute and should be cached.523 524```python525from pydantic import BaseModel, computed_field526 527class Rectangle(BaseModel):528    width: int529    length: int530 531    @computed_field532    @property533    def area(self) -> int:534        return self.width * self.length535 536print(Rectangle(width=3, length=2).model_dump())537#> {'width': 3, 'length': 2, 'area': 6}538```539 540If applied to functions not yet decorated with `@property` or `@cached_property`, the function is541automatically wrapped with `property`. Although this is more concise, you will lose IntelliSense in your IDE,542and confuse static type checkers, thus explicit use of `@property` is recommended.543 544!!! warning "Mypy Warning"545    Even with the `@property` or `@cached_property` applied to your function before `@computed_field`,546    mypy may throw a `Decorated property not supported` error.547    See [mypy issue #1362](https://github.com/python/mypy/issues/1362), for more information.548    To avoid this error message, add `# type: ignore[prop-decorator]` to the `@computed_field` line.549 550    [pyright](https://github.com/microsoft/pyright) supports `@computed_field` without error.551 552```python553import random554 555from pydantic import BaseModel, computed_field556 557class Square(BaseModel):558    width: float559 560    @computed_field561    def area(self) -> float:  # converted to a `property` by `computed_field`562        return round(self.width**2, 2)563 564    @area.setter565    def area(self, new_area: float) -> None:566        self.width = new_area**0.5567 568    @computed_field(alias='the magic number', repr=False)569    def random_number(self) -> int:570        return random.randint(0, 1_000)571 572square = Square(width=1.3)573 574# `random_number` does not appear in representation575print(repr(square))576#> Square(width=1.3, area=1.69)577 578print(square.random_number)579#> 3580 581square.area = 4582 583print(square.model_dump_json(by_alias=True))584#> {"width":2.0,"area":4.0,"the magic number":3}585```586 587!!! warning "Overriding with `computed_field`"588    You can't override a field from a parent class with a `computed_field` in the child class.589    `mypy` complains about this behavior if allowed, and `dataclasses` doesn't allow this pattern either.590    See the example below:591 592```python593from pydantic import BaseModel, computed_field594 595class Parent(BaseModel):596    a: str597 598try:599 600    class Child(Parent):601        @computed_field602        @property603        def a(self) -> str:604            return 'new a'605 606except TypeError as e:607    print(e)608    '''609    Field 'a' of class 'Child' overrides symbol of same name in a parent class. This override with a computed_field is incompatible.610    '''611```612 613Private properties decorated with `@computed_field` have `repr=False` by default.614 615```python616from functools import cached_property617 618from pydantic import BaseModel, computed_field619 620class Model(BaseModel):621    foo: int622 623    @computed_field624    @cached_property625    def _private_cached_property(self) -> int:626        return -self.foo627 628    @computed_field629    @property630    def _private_property(self) -> int:631        return -self.foo632 633m = Model(foo=1)634print(repr(m))635#> Model(foo=1)636```637 638Args:639    func: the function to wrap.640    alias: alias to use when serializing this computed field, only used when `by_alias=True`641    alias_priority: priority of the alias. This affects whether an alias generator is used642    exclude_if: A callable that determines whether to exclude this computed field during serialization based on its value.643    title: Title to use when including this computed field in JSON Schema644    field_title_generator: A callable that takes a field name and returns title for it.645    description: Description to use when including this computed field in JSON Schema, defaults to the function's646        docstring647    deprecated: A deprecation message (or an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport).648        to be emitted when accessing the field. Or a boolean. This will automatically be set if the property is decorated with the649        `deprecated` decorator.650    examples: Example values to use when including this computed field in JSON Schema651    json_schema_extra: A dict or callable to provide extra JSON schema properties.652    repr: whether to include this computed field in model repr.653        Default is `False` for private properties and `True` for public properties.654    return_type: optional return for serialization logic to expect when serializing to JSON, if included655        this must be correct, otherwise a `TypeError` is raised.656        If you don't include a return type Any is used, which does runtime introspection to handle arbitrary657        objects.658 659Returns:660    A proxy wrapper for the property.661c�>�[R"U5nTc1UR(a [R"UR5mTc[US5(aURm[R"U5nTbT=(d SOSmTc[US9(+nOTn[UT
TTT	TT662TTTTU5n[R"X5$)N�__deprecated__r�)r�)r!�unwrap_wrapped_functionrz�inspect�cleandocr�r��ensure_propertyr�r��PydanticDescriptorProxy)�f�	unwrapped�repr_�dec_inforCrErrLrNrRrKrjrnr�rIs    �����������r~�dec�computed_field.<locals>.dec>s�����7�7��:�	���9�#4�#4�!�*�*�9�+<�+<�=�K���'�)�5E�"F�"F�"�1�1�J�
�'�'��*��27�2C�.�-�A�����<�:�Q�G�G�E��E�$�
������!������
663���2�2�1�?�?r})r�rrArrt)
r�rCrErRrIrKrLrrNrjrnr�r�s
 ``````````` r~r6r6�s.����D!@�!@�!@�F�|��664��4�y�r})Jr��ellipsisrCrBrErDrGrFrHrBrIrBrKrJrLrBrNrMrPrOrRrQrgrfrrhrjrirkrOrlrOrnrmrorOrprOrqrOrar`r]rOrrrOrTrSrVrUrXrWrZrYr\r[rbrOrcrDrdrDr^rDr_rDre�!Literal['smart', 'left_to_right']rsrOr_�Unpack[_EmptyKwargs]rAr)Jr�rrCrBrErDrGrFrHrBrIrBrKrJrLrBrNrMrPrOrRrQrgrfrrhrjrirkrOrlrGrnrmrorOrprOrqrOrar`r]rOrrrOrTrSrVrUrXrWrZrYr\r[rbrOrcrDrdrDr^rDr_rDrer�rsrOr_r�rAr)Jr�r^rCrBrErDrGrFrHrBrIrBrKrJrLrBrNrMrPrOrRrQrgrfrrhrjrirkrOrlrJrnrmrorOrprOrqrOrar`r]rOrrrOrTrSrVrUrXrWrZrYr\r[rbrOrcrDrdrDr^rDr_rDrer�rsrOr_r�rAr^)JrAz3Callable[[], Any] | Callable[[dict[str, Any]], Any]rCrBrErDrGrFrHrBrIrBrKrJrLrBrNrMrPrOrRrQrgrfrrhrjrirkrOrlrGrnrmrorOrprOrqrOrar`r]rOrrrOrTrSrVrUrXrWrZrYr\r[rbrOrcrDrdrDr^rDr_rDrer�rsrOr_r�rAr)JrA�1Callable[[], _T] | Callable[[dict[str, Any]], _T]rCrBrErDrGrFrHrBrIrBrKrJrLrBrNrMrPrOrRrQrgrfrrhrjrirkrOrlzLiteral[False] | NonernrmrorOrprOrqrOrar`r]rOrrrOrTrSrVrUrXrWrZrYr\r[rbrOrcrDrdrDr^rDr_rDrer�rsrOr_r�rAr^)HrCrBrErDrGrFrHrBrIrBrKrJrLrBrNrMrPrOrRrQrgrfrrhrjrirkrOrlrOrnrmrorOrprOrqrOrar`r]rOrrrOrTrSrVrUrXrWrZrYr\r[rbrOrcrDrdrDr^rDr_rDrer�rsrOr_r�rAr)Lr�rrAr@rCrBrErDrGrFrHrBrIrBrKrJrLrBrNrMrPrOrRrQrgrfrrhrjrirkrOrlrOrnrmrorOrprOrqrOrar`r]rOrrrOrTrSrVrUrXrWrZrYr\r[rbrOrcrDrdrDr^rDr_rDrer�rsrOr_r�rAr)r�r^rorJrAr^)rAr�rorJrAr^)rorJrAr)r�rrAr@rorJrArrt)r�zcached_property | propertyrArm)r�r�rAr�)rCrBrErDrRrQrIrBrKr�rLrBrrhrNrMrjrirnrmr�rrAz Callable[[PropertyT], PropertyT]r�)r�zPropertyT | NonerCrBrErDrRrQrIrBrKr�rLrBrrhrNrMrjrirnrOr�rrAz,PropertyT | Callable[[PropertyT], PropertyT])erz�665__future__r�_annotationsr�r��rer��collections.abcrrrr�DataclassField�	functoolsr�typingr	r666rrr
rrr�warningsrrNrZ�
pydantic_corerrrrrrr�typing_inspectionr�typing_inspection.introspectionrrrrrr�r �	_internalr!r"r#r$r%r&r'�_internal._namespace_utilsr(r)�aliasesr*r+r,�configr-�errorsr.r/�json_schemar0r1�_internal._configr2�_internal._reprr3�__all__r7r{r�r:r<r�r��Representationr4r]r�r�r^r��	signature�667parametersr��removerzr5�	dataclass�668slots_truer�r�r�r6rtr}r~�<module>r�sD�� �2���	�669�-��/�%�]�]�]����4�L�L�,�x�x��i�i�i�J�<�<��A�2�/��0�)�@�� �������w���$�/�/�*�<�J�	�<�&�J�	�&�'�9�E�'�T�+�5���y����{#��$�$�{#��{#�|j�9�j�670�
�s�671��t�672��T�673��d�	674�675��676��4�
677��T�678��T�679��4�680���681��t�682��$�683��T�684��$�685���686� 
�d�!687�"��#688�$
����+689��0������690�691�692�693�������!���&
�T�]��694695��!'�>D�&,��DJ�$�!'�!�/5�6<�17�FL� �$*���"�!�,2� �)/�,2�,2�,2�,2� &�!'�#�!'�#�#�4:�#�I&�
�&��&��	&�696<�&�$�
&��&�B�&��&��&��&�-�&�4�&�/�&�D�&� 
�!&�""�#&�$�%&�&�'&�(�)&�*�+&�,*�-&�.
�/&�0'�1&�2	*�3&�4	*�5&�6	*�7&�8	*�9&�:�;&�<�=&�>�?&�@�A&�B�C&�D�E&�F2�G&�H�I&�J"�K&�L	�M&�697�&�N698��!'�>D�&,��DJ�$�!'�!�/5�6<�17�FL� ���"�!�,2� �)/�,2�,2�,2�,2� &�!'�#�!'�#�#�4:�#�I&�
�&��&��	&�699<�&�$�
&��&�B�&��&��&��&�-�&�4�&�/�&�D�&� 
�!&�"$�#&�$�%&�&�'&�(�)&�*�+&�,*�-&�.
�/&�0'�1&�2	*�3&�4	*�5&�6	*�7&�8	*�9&�:�;&�<�=&�>�?&�@�A&�B�C&�D�E&�F2�G&�H�I&�J"�K&�L	�M&�700�&�N701��!'�>D�&,��DJ�$�!'�!�06�6<�17�FL� �'*���"�!�,2� �)/�,2�,2�,2�,2� &�!'�#�!'�#�#�4:�#�O)
�
�)
��)
��	)
�702<�)
�$�
)
��)
�B�)
��)
��)
��)
�-�)
� 4�!)
�"/�#)
�$D�%)
�&
�')
�(%�))
�*�+)
�,�-)
�.�/)
�0�1)
�2*�3)
�4
�5)
�6'�7)
�8	*�9)
�:	*�;)
�<	*�=)
�>	*�?)
�@�A)
�B�C)
�D�E)
�F�G)
�H�I)
�J�K)
�L2�M)
�N�O)
�P"�Q)
�R�S)
�703�)
�T704��!'�>D�&,��DJ�$�!'�!�/5�6<�17�FL� ���"�!�,2� �)/�,2�,2�,2�,2� &�!'�#�!'�#�#�4:�#�I&�H�&��&��	&�705<�&�$�
&��&�B�&��&��&��&�-�&�4�&�/�&�D�&� 
�!&�"$�#&�$�%&�&�'&�(�)&�*�+&�,*�-&�.
�/&�0'�1&�2	*�3&�4	*�5&�6	*�7&�8	*�9&�:�;&�<�=&�>�?&�@�A&�B�C&�D�E&�F2�G&�H�I&�J"�K&�L	�M&�706�&�N707��!'�>D�&,��DJ�$�!'�!�06�6<�17�FL� �.4���"�!�,2� �)/�,2�,2�,2�,2� &�!'�#�!'�#�#�4:�#�O)
�F�)
��)
��	)
�708<�)
�$�
)
��)
�B�)
��)
��)
��)
�-�)
� 4�!)
�"/�#)
�$D�%)
�&
�')
�(,�))
�*�+)
�,�-)
�.�/)
�0�1)
�2*�3)
�4
�5)
�6'�7)
�8	*�9)
�:	*�;)
�<	*�=)
�>	*�?)
�@�A)
�B�C)
�D�E)
�F�G)
�H�I)
�J�K)
�L2�M)
�N�O)
�P"�Q)
�R�S)
�709�)
�T710��!'�>D�&,��DJ�$�!'�!�/5�6<�17�FL� �$*���"�!�,2� �)/�,2�,2�,2�,2� &�!'�#�!'�#�#�4:�#�G%��%��%�<�	%�711$�%��
%�B�%��%��%��%�-�%�4�%�/�%�D�%�
�%� "�!%�"�#%�$�%%�&�'%�(�)%�**�+%�,
�-%�.'�/%�0	*�1%�2	*�3%�4	*�5%�6	*�7%�8�9%�:�;%�<�=%�>�?%�@�A%�B�C%�D2�E%�F�G%�H"�I%�J	�K%�712�%�N%�a�SY��!'�>D�&,��DJ�$�!'�!�/5�6<�17�FL� �$*���"�!�,2� �)/�,2�,2�,2�,2� &�!'�#�!'�#�#�4:�#�Ka�
�a�P�a��	a�713�a�<�
a�$�a��a�B�a��a��a��a�-�a�4�a�/�a� D�!a�"
�#a�$"�%a�&�'a�(�)a�*�+a�,�-a�.*�/a�0
�1a�2'�3a�4	*�5a�6	*�7a�8	*�9a�:	*�;a�<�=a�>�?a�@�Aa�B�Ca�D�Ea�F�Ga�H2�Ia�J�Ka�L"�Ma�N	�Oa�H�w�(�(��/�:�:�;������ �[714�u�+�+�[715�@716�!�
�
�
��
��	
�717�
�718719�!�
�F�
��
��	
�720�
�721722�!��723��	��724��725%�#�SW� �	#�
�#�P�#��	#�726	�#�L
���8�,�7�7�8�bS�bS�9�bS�J	N�
�K� �	�727�8�728�8�729��!%�/3��LP�"�15�!%�FJ��(�
+��
+��
+�-�	
+�730�
+�J�

+��
+�/�
+��
+�D�
+��
+��
+�&�
+�731�
+�""�H��!%�/3��LP�"�15�!%�FJ��(�H�732�H��	H�733�H�-�
H��H�J�H��H�/�H��H�D�H��H��H�2�Hr}
codekingpro/portable-devtools · Team Ai