
    /Jf;                         d Z ddlmZ ddlmZ ddlmZ ddlmZ	 ddl
mZmZmZmZmZ ddlmZ 	 dd	d	d	d	d	d
dd
dd	ddd
d	dd
d	d	d	d
ddZeZ eed
d	          Zed	d
d	d
d	d	d	d	dd	d	d	d	ddZd
d	d	ddZd
d	ddZd	S )z]
These are keyword-only APIs that call `attr.s` and `attr.ib` with different
default values.
    )partial   )setters)asdict)astuple)NOTHING_frozen_setattrs_ng_default_on_setattrattribattrs)UnannotatedAttributeErrorNTF)thesereprunsafe_hashhashinitslotsfrozenweakref_slotstrauto_attribskw_only
cache_hashauto_exceqorderauto_detectgetstate_setstate
on_setattrfield_transformer
match_argsc                   	
 	fd
fd}| |S  ||           S )a  
    Define an *attrs* class.

    Differences to the classic `attr.s` that it uses underneath:

    - Automatically detect whether or not *auto_attribs* should be `True` (c.f.
      *auto_attribs* parameter).
    - Converters and validators run when attributes are set by default -- if
      *frozen* is `False`.
    - *slots=True*

      .. caution::

         Usually this has only upsides and few visible effects in everyday
         programming. But it *can* lead to some surprising behaviors, so please
         make sure to read :term:`slotted classes`.
    - *auto_exc=True*
    - *auto_detect=True*
    - *order=False*
    - Some options that were only relevant on Python 2 or were kept around for
      backwards-compatibility have been removed.

    Please note that these are all defaults and you can change them as you
    wish.

    :param Optional[bool] auto_attribs: If set to `True` or `False`, it behaves
       exactly like `attr.s`. If left `None`, `attr.s` will try to guess:

       1. If any attributes are annotated and no unannotated `attrs.fields`\ s
          are found, it assumes *auto_attribs=True*.
       2. Otherwise it assumes *auto_attribs=False* and tries to collect
          `attrs.fields`\ s.

    For now, please refer to `attr.s` for the rest of the parameters.

    .. versionadded:: 20.1.0
    .. versionchanged:: 21.3.0 Converters are also run ``on_setattr``.
    .. versionadded:: 22.2.0
       *unsafe_hash* as an alias for *hash* (for :pep:`681` compliance).
    c                     t          di d| ddd	dd
ddd	d
d|ddddddddddddS )N	maybe_clsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   collect_by_mroTr   r   r    r!    )r   )clsr   r   r   r   r   r    r   r   r   r   r   r!   r   r   r   r   r   r   r   r   s     Q/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/attr/_next_gen.pydo_itzdefine.<locals>.do_itY   s     
 
 
c
%
 
 	

 $
 
 %
 6
 &
 
 &
 G
 "z
 X
 r
  %!
" $#
$  4%
& 0/'
( "z)
* 0/+
, "z-
 	
    c                    dt           j        fv}du r	t          | j        D ]1}|j        t
          u r!|rd}t          |          t           j         n2 |           S 	  | d          S # t          $ r  | d          cY S w xY w)z
        Making this a wrapper ensures this code runs during class creation.

        We also ensure that frozen-ness of classes is inherited.
        NFz@Frozen classes can't use on_setattr (frozen-ness was inherited).T)r   NO_OPr
   	__bases____setattr__r	   
ValueErrorr   )r'   had_on_setattrbase_clsmsgr   r)   r   r   s       r(   wrapzdefine.<locals>.wraps   s     $D'-+@@ U??z1/J  	 	H#'777! *\C$S//)$]
 8 #5l+++	%5d###( 	% 	% 	%5e$$$$$	%s   'A3 3BBr&   )r$   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r3   r)   s    ```````````````````` @r(   definer4      s    B
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4% % % % % % % %F 4	??r*   )r   r   default	validatorr   r   r   metadatatype	converterfactoryr   r   r   r   aliasc                 <    t          | |||||||||	|
|||          S )a  
    Identical to `attr.ib`, except keyword-only and with some arguments
    removed.

    .. versionadded:: 23.1.0
       The *type* parameter has been re-added; mostly for `attrs.make_class`.
       Please note that type checkers ignore this metadata.
    .. versionadded:: 20.1.0
    r5   )r   r5   s                 r(   fieldr>      sE    4    r*   )recursefiltervalue_serializerc                *    t          | |||d          S )z
    Same as `attr.asdict`, except that collections types are always retained
    and dict is always used as *dict_factory*.

    .. versionadded:: 21.3.0
    T)instr?   r@   rA   retain_collection_types)_asdict)rC   r?   r@   rA   s       r(   r   r      s*     ) $   r*   )r?   r@   c                (    t          | ||d          S )z
    Same as `attr.astuple`, except that collections types are always retained
    and `tuple` is always used as the *tuple_factory*.

    .. versionadded:: 21.3.0
    T)rC   r?   r@   rD   )_astuple)rC   r?   r@   s      r(   r   r      s$     764   r*   )N)__doc__	functoolsr    r   _funcsr   rE   r   rG   _maker   r	   r
   r   r   
exceptionsr   r4   mutabler   r>   r&   r*   r(   <module>rO      s                % % % % % % ' ' ' ' ' '              2 1 1 1 1 1 A 			

-A A A A AH 		6	6	6
 				

) ) ) ) )X !       "$ 	 	 	 	 	 	 	r*   