
    ic                         S SK r S SK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JrJrJr   " S S	\\   5      rg)
    N)CallableSequence)&check_sideeffect_during_initialization)InvalidArgument)ConjectureData)get_pretty_function_description)ExRecurTSearchStrategycheck_strategyc                      ^  \ rS rSrSrS\/ \\   4   4U 4S jjr\	S\\   4S j5       r
\	S\\\      4S j5       rS\4S jrS	\S\4S
 jrS	\S\4S jrS\4S jrS\S\4S jrSrU =r$ )DeferredStrategy   z8A strategy which may be used before it is fully defined.
definitionc                 J   > [         TU ]  5         S U l        SU l        Xl        g )NF)super__init__#_DeferredStrategy__wrapped_strategy_DeferredStrategy__in_repr_DeferredStrategy__definition)selfr   	__class__s     g/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/hypothesis/strategies/_internal/deferred.pyr   DeferredStrategy.__init__   s#    =A$EO    returnc                 D   U R                   nU R                  c|  [        SU 5        [        R                  " U5      (       d&  [        SU< S[        U5      R                   S35      eU" 5       nX L a  [        S5      e[        US5        X l        S U l         U R                  $ )Nzdeferred evaluation of {!r}z-Expected definition to be a function but got z	 of type z	 instead.z.Cannot define a deferred strategy to be itselfzdefinition())	r   r   r   inspect
isfunctionr   type__name__r   )r   r   results      r   wrapped_strategy!DeferredStrategy.wrapped_strategy#   s     &&
""*23PRVW%%j11%CJ> R#J/889D   \F~%&VWW6>2&,# $D&&&r   c                 .    U R                   R                  $ N)r#   branchesr   s    r   r'   DeferredStrategy.branches8   s    $$---r   c                     U R                   $ )a   Deferred strategies don't have a calculated label, because we would
end up having to calculate the fixed point of some hash function in
order to calculate it when they recursively refer to themself!

The label for the wrapped strategy will still appear because it
will be passed to draw.
)class_labelr(   s    r   
calc_labelDeferredStrategy.calc_label<   s     r   recurc                 &    U" U R                   5      $ r&   r#   r   r.   s     r   calc_is_emptyDeferredStrategy.calc_is_emptyI       T**++r   c                 &    U" U R                   5      $ r&   r0   r1   s     r   calc_has_reusable_values)DeferredStrategy.calc_has_reusable_valuesL   r4   r   c                     U R                   bE  U R                  (       a  S[        U 5      < S3$  SU l        [        U R                   5      SU l        $ [	        U R
                  5      nSU S3$ ! SU l        f = f)Nz
(deferred@)TFz	deferred()r   r   idreprr   r   )r   descriptions     r   __repr__DeferredStrategy.__repr__O   ss    "".~~#BtH<q11'!%D334!&9$:K:KLK{m1-- "'s   A. .	A7datac                 8    UR                  U R                  5      $ r&   )drawr#   )r   r?   s     r   do_drawDeferredStrategy.do_draw\   s    yy..//r   )__definition	__in_repr__wrapped_strategy)r!   
__module____qualname____firstlineno____doc__r   r   r	   r   propertyr#   r   r'   intr,   r
   boolr2   r6   strr=   r   rB   __static_attributes____classcell__)r   s   @r   r   r      s    BP8Br0B,B#C P '."4 ' '( .(>"#56 . . C  ,6 ,d ,,f , ,.# .0N 0r 0 0r   r   )r   collections.abcr   r   hypothesis.configurationr   hypothesis.errorsr   #hypothesis.internal.conjecture.datar   hypothesis.internal.reflectionr   *hypothesis.strategies._internal.strategiesr	   r
   r   r   r    r   r   <module>rX      s6     . K - > J C0~b) C0r   