
    i
              	       v    S r SSKJr  SSKJrJrJrJr  SSKJ	r	  \" S5      r
  SS\	S	\\   S
\\   SS4S jjrg)z:Strategy for using class-specific (un)structuring methods.    )	signature)AnyCallableOptionalTypeVar   )BaseConverterTN	converterstructure_method_nameunstructure_method_namereturnc                 @  ^ ^^ T(       aL  S[         [           S[        [        [         [           /[        4   4U U4S jjnT R	                  U4S jU5        T(       aA  S[         [           S[        [        /[        4   4U U4S jjnT R                  U4S jU5        gg)a  
Configure the converter such that dedicated methods are used for (un)structuring
the instance of a class if such methods are available. The default (un)structuring
will be applied if such an (un)structuring methods cannot be found.

:param converter: The `Converter` on which this strategy is applied. You can use
    :class:`cattrs.BaseConverter` or any other derived class.
:param structure_method_name: Optional string with the name of the class method
    which should be used for structuring. If not provided, no class method will be
    used for structuring.
:param unstructure_method_name: Optional string with the name of the class method
    which should be used for unstructuring. If not provided, no class method will
    be used for unstructuring.

If you want to (un)structured nested objects, just append a converter parameter
to your (un)structuring methods and you will receive the converter there.

.. versionadded:: 23.2.0
clr   c                    >^ [        U T5      m[        [        T5      R                  5      nUS:X  a  U4S j$ US:X  a  UU4S j$ [	        S5      e)N   c                    > T" U 5      $ N )v_fns     _/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/cattrs/strategies/_class_methods.py<lambda>Huse_class_methods.<locals>.make_class_method_structure.<locals>.<lambda>*   s	    BqE    r   c                    > T" U T5      $ r   r   )r   r   r   r   s     r   r   r   ,   s    Bq)$4r   z1Provide a class method with one or two arguments.getattrlenr   
parameters	TypeError)r   n_parametersr   r   r   s     @r   make_class_method_structure6use_class_methods.<locals>.make_class_method_structure&   sL    23By}778Lq ))q 44OPPr   c                    > [        U T5      $ r   hasattr)tr   s    r   r   #use_class_methods.<locals>.<lambda>0   s    ga!67r   c                    >^ [        U T5      m[        [        T5      R                  5      nUS:X  a  T$ US:X  a  UU4S j$ [	        S5      e)Nr   r   c                    > T" U T5      $ r   r   )self_r   r   s    r   r   Juse_class_methods.<locals>.make_class_method_unstructure.<locals>.<lambda>;   s    Ry%9r   z)Provide a method with no or one argument.r   )r   r#   r   r   r   s     @r   make_class_method_unstructure8use_class_methods.<locals>.make_class_method_unstructure5   sK    45By}778Lq 	q 99GHHr   c                    > [        U T5      $ r   r'   )r)   r   s    r   r   r*   ?   s    ga!89r   N)typer
   r   r   register_structure_hook_factory!register_unstructure_hook_factory)r   r   r   r$   r/   s   ```  r   use_class_methodsr5      s    2 	QDG 	Q#tAwQRAR8S 	Q 	Q 	1179T	
 	Id1g 	I(A36:J 	I 	I 	339;X	
 r   )NN)__doc__inspectr   typingr   r   r   r    r	   r
   strr5   r   r   r   <module>r;      sV    @  3 3 CL
 ,0-15
5
#C=5
 &c]5
 
	5
r   