
    gB                       S r SSKJr  SSKrSSKrSSKJr  SSKJr  SSK	J
r
JrJr  SSKJrJrJrJr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJrJ r   SSK!J"r"  SSK#J$r$  SSK%J&r&  \(       a  SSK'J(r(  SSK)J*r*  SSK+J,r,  SSK-J.r.  SSK/J0r0   " S S\$5      r1S(S jr2\" SS9S)S j5       r3S*S jr4SS.           S+S  jjr5S,S! jr6S-S" jr7SSSS#.         S.S$ jjr8S/S% jr9S/S& jr:    S0S' jr;g)1zmPrivate logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.    )annotationsN)copy)	lru_cache)	Parameterismethoddescriptor	signature)TYPE_CHECKINGAnyCallablePattern)PydanticUndefined)TypeIs)PydanticUserError   )_typing_extra)ConfigWrapper)extract_docstrings_from_cls)import_cached_base_modelimport_cached_field_info)
NsResolver)Representation)can_be_positionalBaseMetadata   )	FieldInfo)	BaseModel)StandardDataclass)DecoratorInfosc                      \ rS rSrSrSrSrg)PydanticMetadata"   z0Base class for annotation markers like `Strict`. N)__name__
__module____qualname____firstlineno____doc__	__slots____static_attributes__r#       S/home/matz/Project1/venv/lib/python3.13/site-packages/pydantic/_internal/_fields.pyr!   r!   "   s
    :Ir+   r!   c                 "    [        5       " U 5      $ )zCreate a new `_PydanticGeneralMetadata` class with the given metadata.

Args:
    **metadata: The metadata to add.

Returns:
    The new `_PydanticGeneralMetadata` class.
)_general_metadata_cls)metadatas    r,   pydantic_general_metadatar0   (   s     !"8,,r+   )maxsizec                 2    SSK Jn    " S S[        U 5      nU$ )zCDo it this way to avoid importing `annotated_types` at import time.r   r   c                  "    \ rS rSrSrSS jrSrg)7_general_metadata_cls.<locals>._PydanticGeneralMetadata9   z,Pydantic general metadata like `max_digits`.c                    Xl         g N__dict__)selfr/   s     r,   __init__@_general_metadata_cls.<locals>._PydanticGeneralMetadata.__init__<   s    $Mr+   r8   N)r/   r
   )r$   r%   r&   r'   r(   r;   r*   r#   r+   r,   _PydanticGeneralMetadatar4   9   s
    :	%r+   r=   )annotated_typesr   r!   )r   r=   s     r,   r.   r.   4   s     -%#3\ % $#r+   c                    UR                   (       aD  [        U 5      nUR                  5        H$  u  pEUR                  b  M  XC;   d  M  X4   Ul        M&     g g r7   )use_attribute_docstringsr   itemsdescription)clsfieldsconfig_wrapperfields_docsann_name
field_infos         r,   _update_fields_from_docstringsrI   B   sI    ..1#6$*LLN H%%-(2I)4)>
& %3 /r+   )typevars_mapc               
   [        5       n[        5       n0 n[        U5       H*  n[        USS5      =n	(       d  M  UR	                  U	5        M,     [
        R                  " XS9n
U R                  R                  S0 5      n0 n[        5       nU
R                  5        GH  u  nu  nnUS:X  a  M  UR                   GHc  nSn[        U[        5      (       a  UR                  U5      SLnO&[        U[        5      (       a  UR!                  U5      nU(       d  M^  U HW  n[#        UU5      (       d  M  [%        UU5      (       a  U[        US0 5      ;   a  M:  ['        SU S[        UU5       S	U S
35      e   SnUR                   Hd  n[        U[        5      (       a.  UR                  U5      (       d  USUR(                   S34-  nMD  MF  UR!                  U5      (       a  M^  UU4-  nMf     [*        R,                  " SU SU R.                   SU SU S3	[0        5        GMf     [
        R2                  " U5      (       a  UR5                  U5        GM  [7        U[        X[8        5      5      (       a  UR5                  U5        GM  [;        U5      (       d  GM  U R<                  (       a  US:w  a  ['        SU< S35      e[        U S0 5      R                  S5      nU H  n[>        R@                  " U5      (       a  [>        RB                  " U5      OS Vs1 s H  nURD                  iM     nn[#        X5      (       d  Mb  UUL a  Mi  UU;   a  Mq  X;  a  Mx  [*        R,                  " SU SU RF                   SURF                   S3[0        5        M      [        X[8        5      nU[8        L a  [H        e [K        X5        [        UU5      (       a;  [M        URN                  5      (       a!  URN                  RQ                  SU 5      Ul'        URS                  UU5      nUUl*         [W        X5        U R                  S   nUUR\                  ;   a  [_        S5      eUX'   GM     U(       a(  URa                  5        H  nURc                  U5        M     [e        XU5        X4$ s  snf ! [H         a     Nf = f! [H         aN    X;   a  URY                  U5      nUUl*         NX;   a  [[        X~   5      n NURY                  U5      nUUl*         Nf = f)a"  Collect the fields of a nascent pydantic model.

Also collect the names of any ClassVars present in the type hints.

The returned value is a tuple of two items: the fields dict, and the set of ClassVar names.

Args:
    cls: BaseModel or dataclass.
    bases: Parents of the class, generally `cls.__bases__`.
    config_wrapper: The config wrapper instance.
    ns_resolver: Namespace resolver to use when getting model annotations.
    typevars_map: A dictionary mapping type variables to their concrete types.

Returns:
    A tuple contains fields and class variables.

Raises:
    NameError:
        - If there is a conflict between a field name and protected namespaces.
        - If there is a field other than `root` in `RootModel`.
        - If a field shadows an attribute in the parent model.
__pydantic_fields__N)ns_resolver__annotations__model_configFzField "z" conflicts with member z of protected namespace "z".r#   zre.compile()z" in z( has conflict with protected namespace "z_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = z`.rootzUnexpected field with name z4; only 'root' is allowed as a field of a `RootModel`__pydantic_generic_metadata__originzField name "z" in "z"" shadows an attribute in parent ""__pydantic_decorators__z0you can't override a field with a computed field)3r   r   reversedgetattrupdater   get_model_type_hintsr9   getsetrA   protected_namespaces
isinstancer   matchstr
startswithhasattr
issubclass	NameErrorpatternwarningswarnr$   UserWarningis_classvar_annotationadd_is_finalvar_with_default_valr   is_valid_field_name__pydantic_root_model__dataclassesis_dataclassrD   namer&   AttributeError#_warn_on_nested_alias_in_annotationr   default__get__from_annotated_attribute	evaluateddelattrfrom_annotationr   computed_fields
ValueErrorvaluesapply_typevars_maprI   )rC   basesrE   rM   rJ   r   
FieldInfo_parent_fields_lookupbasemodel_fields
type_hintsr   rD   
class_varsrG   ann_typeru   protected_namespacens_violationbvalid_namespacespngeneric_originfielddataclass_fieldsrr   rH   
decoratorss                               r,   collect_model_fieldsr   J   s   < )*I)+J13"4)>EE<E ''5   33CQJ ,,""#4b9K#%F5J+5+;+;+=''8Y~% #1#F#F!&L-w77288B$N/55'223FG|Aq(++ *1i 8 8XQRTikmIn=n"+")(3KGTUW_L`Ka";<O;PPR!T#   (*$,AA%b'22#%88H#5#5 0{2::,a5P4R R 0 $6 $,#6#6r#:#: 0RE 9 0 B MM!(5>fgzf{ |DDTCUUWY $	3 $G> //99NN8$(73J[3\]]NN8$"8,,&&8v+=-h\9mn  !&ErJNNxXDEPE]E]^bEcEc););D)Aik)k )ku

)k    t&&>)// ."8*F33C3C2D E))*!-% 0&	c->?G++$$ ,( 0C':..3Egoo3V3V
 #*//"9"9$"D#<<XwOJ#,J & &)\\2K%L
z111OPP%w ,>z ]]_E$$\2 % #3?W x " C  	5&'77A
'0
$ 3 "&&:&D!EJ
 ",!;!;H!EJ+4J(!	5s6   RR4#R$$
R10R14'TT1TTc                J   [        5       n[        U SS 5      nU(       a  U H~  n[        R                  " U5      (       d  M   [        R                  " U5       HD  n[        XR5      (       d  M  UR                  c  M$  [        R                  " SU S3[        5            g    M     g g )N__args__z `alias` specification on field "z5" must be set on outermost annotation to take effect.)
r   rW   r   is_annotatedget_argsr]   aliasre   rf   rg   )r   rG   r   argsanno_arganno_type_args         r,   rq   rq      s    (*I8Z.DH))(33%2%;%;H%EM!-;;@S@S@_ >xjH}~'  &F  r+   c                    [        5       n[        R                  " U 5      (       d  gU[        L a  g[	        X5      (       a!  UR
                  [        L a  UR                  c  gg)NFT)r   r   is_finalvarr   r]   rr   default_factory)type_valr   s      r,   rj   rj     sR    (*I$$U++	!	!	C	#	#8I)IcNaNaNir+   )rM   rJ   rE   c          
        [        5       n0 nU=(       d
    [        5       nU R                  n[        U R                  5       GH  n[
        R                  " U5      (       d  M!  UR                  U5         UR                  5        GH  u  pXR                  R                  S0 5      ;  a  M'  UR                  u  p[        R                  " U	R                  X5      u  p[        R                  " U5      (       a  Mu  U	R                   (       d<  U	R"                  [
        R$                  L a  U	R&                  [
        R$                  L a  M  [)        U	R"                  U5      (       aa  U	R"                  R*                  (       a*  U	R"                  R                   SL a  [-        SU S3SS9eGM"  UR/                  XR"                  5      nOUR/                  X5      nXU'   UR"                  [0        Ld  GMi  [)        [3        XU5      U5      (       d  GM  [5        XUR"                  5        GM     SSS5        GM     U(       a(  UR7                  5        H  nUR9                  U5        M     Ub  [;        XU5        U$ ! , (       d  f       GMB  = f)aX  Collect the fields of a dataclass.

Args:
    cls: dataclass.
    ns_resolver: Namespace resolver to use when getting dataclass annotations.
        Defaults to an empty instance.
    typevars_map: A dictionary mapping type variables to their concrete types.
    config_wrapper: The config wrapper instance.

Returns:
    The dataclass fields.
rN   FzDataclass field zD has init=False and init_var=True, but these are mutually exclusive.zclashing-init-and-init-var)codeN)r   r   __dataclass_fields__rV   __mro__rm   rn   pushrA   r9   rZ   types_namespacer   try_eval_typetyperh   initrr   MISSINGr   r]   init_varr   rt   r   rW   setattrrz   r{   rI   )rC   rM   rJ   rE   r}   rD   r   r   rG   dataclass_fieldglobalnslocalnsr   _rH   r   s                   r,   collect_dataclass_fieldsr     s    & *+J#%F-K//
 %''--d#-=-C-C-E)==#4#45F#KK $/$?$?!+99/:N:NPXb 77AA (,,'//;3F3FF'77;;N;NN o55zBB&..77*22775@"3"28*  =A  !B%A#  !!+!D!DXOfOf!gJ!+!D!DX!_J#-x %%->>:C:6
D D C:+=+=>S .F $#	 &` ]]_E $$\2	 % !&sNCMm $#s   3E5I3-I3I33
J	c                .    U R                  S5      (       + $ )Nr   r`   ro   s    r,   rk   rk   s  s    s###r+   c                ^    U R                  S5      =(       a    U R                  S5      (       + $ )Nr   __r   r   s    r,   is_valid_privateattr_namer   w  s"    ??3=(=$==r+   c                    [        U 5      n[        UR                  R                  5       5      n[        U5      S:H  =(       a4    [        US   5      =(       a    US   R                  [        R                  L $ ! [        [        4 a     gf = f)zMWhether the provided default factory callable has a validated data parameter.Fr   r   )r   ry   	TypeErrorlist
parametersrz   lenr   rr   r   empty)r   sigr   s      r,   takes_validated_data_argumentr   {  s    ( cnn++-.Jz?aq$5jm$DqTUI^I^bkbqbqIqq 	"  s   A9 9BB)r/   r
   returnr   )r   ztype[BaseMetadata])rC   	type[Any]rD   dict[str, FieldInfo]rE   r   r   None)rC   ztype[BaseModel]r|   ztuple[type[Any], ...]rE   r   rM   NsResolver | NonerJ   dict[Any, Any] | Noner   z%tuple[dict[str, FieldInfo], set[str]])r   r   rG   r_   r   r   )r   r   r   r
   r   bool)
rC   ztype[StandardDataclass]rM   r   rJ   r   rE   zConfigWrapper | Noner   r   )ro   r_   r   r   )r   z3Callable[[], Any] | Callable[[dict[str, Any]], Any]r   z'TypeIs[Callable[[dict[str, Any]], Any]])<r(   
__future__r   _annotationsrm   re   r   	functoolsr   inspectr   r   r   typingr	   r
   r   r   pydantic_corer   typing_extensionsr   pydantic.errorsr    r   _configr   _docs_extractionr   _import_utilsr   r   _namespace_utilsr   _reprr   _utilsr   r>   r   rD   r   mainr   _dataclassesr   _decoratorsr   r!   r0   r.   rI   r   rq   rj   r   rk   r   r   r#   r+   r,   <module>r      s?   s 2     < < 8 8 + $ -  " 9 M ( ! %," /+~ 	- 4
$ 
$? +/p	p p "p #	p (p +pf 
  &**.+/V	 V #V (	V
 )V Vr$>rHr,rr+   