
    ,h              	         d dl mZ d dlZd dlmZmZmZmZmZm	Z	m
Z
mZmZmZ d dlZddlmZmZ erd dlmZmZ  ed      Znd Zg d	Z ed
d      Z ed      Ze	 	 	 	 	 	 	 	 dd       Ze	 	 	 	 	 	 	 	 dd       Z	 	 	 	 	 	 	 	 ddZe	 	 	 	 	 	 	 	 dd       Ze	 	 	 	 	 	 	 	 d d       Z	 	 	 	 	 	 	 	 d dZ ej6                  ddd       G d dej8                  e	e                Ze ej6                  ddd       G d dee   e	e                       Ze ej6                  ddd       G d dee
                       Zeee   ef   Z y)!    )annotationsN)
TYPE_CHECKINGAsyncGenerator	AwaitableCallable	GeneratorGenericNoReturnTypeVarUnionoverload   )AlreadyUsedErrorremove_tb_frames)	ParamSpecfinalArgsTc                    | S N )funcs    O/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/outcome/_impl.pyr   r      s        )ErrorOutcomeMaybeValueacapturecaptureValueTT)	covariantResultTr   c                     y r   r   sync_fnargskwargss      r   r   r   $   s     r   c                     y r   r   r$   s      r   r   r   .   s     r   c                    	 t         | |i |      S # t        $ r!}t        |d      }t        |      cY d}~S d}~ww xY w)zRun ``sync_fn(*args, **kwargs)`` and capture the result.

    Returns:
      Either a :class:`Value` or :class:`Error` as appropriate.

    r   Nr   BaseExceptionr   r   )r%   r&   r'   excs       r   r   r   7   sB    Wd-f-.. sA&Szs    	=8==c                   K   y wr   r   async_fnr&   r'   s      r   r   r   I            c                   K   y wr   r   r.   s      r   r   r   R   r0   r1   c                   K   	 t         | |i | d{         S 7 # t        $ r!}t        |d      }t        |      cY d}~S d}~ww xY ww)zRun ``await async_fn(*args, **kwargs)`` and capture the result.

    Returns:
      Either a :class:`Value` or :class:`Error` as appropriate.

    Nr   r*   )r/   r&   r'   r,   s       r   r   r   [   sK     8T4V44554 sA&Szs:   A  A 	A	AA	AA		AF)reprinitslotsc                      e Zd ZU dZ ej
                  ddd      Zded<   ddZe	j                  dd       Ze	j                  dd       Ze	j                  dd	       Zy
)r   a;  An abstract class representing the result of a Python computation.

    This class has two concrete subclasses: :class:`Value` representing a
    value, and :class:`Error` representing an exception.

    In addition to the methods described below, comparison operators on
    :class:`Value` and :class:`Error` objects (``==``, ``<``, etc.) check that
    the other object is also a :class:`Value` or :class:`Error` object
    respectively, and then compare the contained objects.

    :class:`Outcome` objects are hashable if the contained objects are
    hashable.

    F)defaulteqr5   bool
_unwrappedc                V    | j                   rt        t        j                  | dd       y )Nr;   T)r;   r   object__setattr__selfs    r   _set_unwrappedzOutcome._set_unwrapped   s!    ??""4t4r   c                     y)zReturn or raise the contained value or exception.

        These two lines of code are equivalent::

           x = fn(*args)
           x = outcome.capture(fn, *args).unwrap()

        Nr   r?   s    r   unwrapzOutcome.unwrap       r   c                     y)zSend or throw the contained value or exception into the given
        generator object.

        Args:
          gen: A generator object supporting ``.send()`` and ``.throw()``
              methods.

        Nr   r@   gens     r   sendzOutcome.send   rD   r   c                   K   yw)zSend or throw the contained value or exception into the given async
        generator object.

        Args:
          agen: An async generator object supporting ``.asend()`` and
              ``.athrow()`` methods.

        Nr   r@   agens     r   asendzOutcome.asend   s     r1   N)returnNonerM   r    rG   z"Generator[ResultT, ValueT, object]rM   r"   rK   zAsyncGenerator[ResultT, ValueT]rM   r"   )__name__
__module____qualname____doc__attribr;   __annotations__rA   abcabstractmethodrC   rH   rL   r   r   r   r   r   m   su     twwuUCJC5
 	  	  	 r   r   )frozenr4   r6   c                  `    e Zd ZU dZ ej
                         Zded<   	 d	dZd
dZ	ddZ
ddZy)r   zFConcrete :class:`Outcome` subclass representing a regular value.

    r    valuec                "    d| j                   dS )NzValue())r]   r?   s    r   __repr__zValue.__repr__       

~Q''r   c                :    | j                          | j                  S r   )rA   r]   r?   s    r   rC   zValue.unwrap   s    zzr   c                X    | j                          |j                  | j                        S r   )rA   rH   r]   rF   s     r   rH   z
Value.send   s!    xx

##r   c                t   K   | j                          |j                  | j                         d {   S 7 wr   )rA   rL   r]   rJ   s     r   rL   zValue.asend   s+     ZZ

++++   /868NrM   strrO   rP   rQ   )rR   rS   rT   rU   rV   rW   r]   rX   r`   rC   rH   rL   r   r   r   r   r      s2     DGGIE6($,r   r   c                      e Zd ZU dZ ej
                  ej                  j                  e            Z	de
d<   	 d
dZddZddZddZy	)r   zIConcrete :class:`Outcome` subclass representing a raised exception.

    )	validatorr+   errorc                "    d| j                   dS )NzError(r_   )rj   r?   s    r   r`   zError.__repr__   ra   r   c                N    | j                          | j                  }	 |# ~~ w xY wr   )rA   rj   )r@   captured_errors     r   rC   zError.unwrap   s-     	%   s     $c                X    | j                          |j                  | j                        S r   )rA   throwrj   rF   s     r   rH   z
Error.send   s!    yy$$r   c                t   K   | j                          |j                  | j                         d {   S 7 wr   )rA   athrowrj   rJ   s     r   rL   zError.asend   s+     [[,,,,re   Nrf   )rM   r
   )rG   z$Generator[ResultT, NoReturn, object]rM   r"   )rK   z!AsyncGenerator[ResultT, NoReturn]rM   r"   )rR   rS   rT   rU   rV   rW   
validatorsinstance_ofr+   rj   rX   r`   rC   rH   rL   r   r   r   r   r      sK     #477//--m<E=  *(%,%-r   )r%   zCallable[ArgsT, NoReturn]r&   
ArgsT.argsr'   ArgsT.kwargsrM   r   )r%   zCallable[ArgsT, ResultT]r&   rt   r'   ru   rM   Value[ResultT] | Error)r/   z$Callable[ArgsT, Awaitable[NoReturn]]r&   rt   r'   ru   rM   r   )r/   z#Callable[ArgsT, Awaitable[ResultT]]r&   rt   r'   ru   rM   rv   )!
__future__r   rY   typingr   r   r   r   r   r	   r
   r   r   r   rV   _utilr   r   typing_extensionsr   r   r   __all__r    r"   r   r   sABCr   r   r   r   r   r   r   <module>r~      sG   " 
    52gE H	T	*
)
 
*  	
  
 
)  	 
)  	$ 
6  	 
 
5  	 
5  	$ Ud+5cggwv 5 ,5p t%t,,GFOWV_ , - ,0 t%t,)-GH )- - )-Z 	eFmU"#r   