
    Ifba                        S SK r S SKrSSKJrJr  / SQrS rS r\R                  " SSSS	9 " S
 S\ R                  5      5       r
\R                  " SSSS9 " S S\
5      5       r\R                  " SSSS9 " S S\
5      5       rg)    N   )AlreadyUsedErrorremove_tb_frames)ErrorOutcomeValueacapturecapturec                      [        U " U0 UD65      $ ! [         a!  n[        US5      n[        U5      s SnA$ SnAff = f)zRun ``sync_fn(*args, **kwargs)`` and capture the result.

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

r   Nr   BaseExceptionr   r   )sync_fnargskwargsexcs       //usr/lib/python3/dist-packages/outcome/_impl.pyr
   r
   
   sB    Wd-f-.. sA&Szs    
>9>>c                    #     [        U " U0 UD6I Sh  vN 5      $  N! [         a!  n[        US5      n[        U5      s SnA$ SnAff = f7f)zRun ``await async_fn(*args, **kwargs)`` and capture the result.

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

Nr   r   )async_fnr   r   r   s       r   r	   r	      sJ     8T4V44554 sA&Szs;   A  A 
A
AA
 AA

AFT)reprinitslotsc                       \ rS rSrSr\R                  " SSSS9rS r\	R                  S 5       r\	R                  S 5       r\	R                  S 5       rS	rg
)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eqr   c                 `    U R                   (       a  [        e[        R                  U SS5        g )N
_unwrappedT)r   r   object__setattr__selfs    r   _set_unwrappedOutcome._set_unwrapped8   s!    ??""4t4    c                     g)zReturn or raise the contained value or exception.

These two lines of code are equivalent::

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

N r    s    r   unwrapOutcome.unwrap=       r$   c                     g)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   sendOutcome.sendH   r)   r$   c                    #    g7f)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   asendOutcome.asendS   s     s   r&   N)__name__
__module____qualname____firstlineno____doc__attribr   r"   abcabstractmethodr'   r-   r2   __static_attributes__r&   r$   r   r   r   &   sn     5u=J5
 	  	  	 r$   r   )frozenr   r   c                   T    \ rS rSrSr\R                  " 5       r S rS r	S r
S rSrg)	r   _   zFConcrete :class:`Outcome` subclass representing a regular value.

    c                 $    SU R                   < S3$ )NzValue())valuer    s    r   __repr__Value.__repr__h       

~Q''r$   c                 :    U R                  5         U R                  $ N)r"   rC   r    s    r   r'   Value.unwrapk   s    zzr$   c                 X    U R                  5         UR                  U R                  5      $ rH   )r"   r-   rC   r+   s     r   r-   
Value.sendo   s!    xx

##r$   c                 t   #    U R                  5         UR                  U R                  5      I S h  vN $  N7frH   )r"   r2   rC   r0   s     r   r2   Value.asends   s*     ZZ

++++   /868r&   N)r4   r5   r6   r7   r8   r9   r:   rC   rD   r'   r-   r2   r=   r&   r$   r   r   r   _   s+     GGIE($,r$   r   c                       \ rS rSrSr\R                  " \R                  R                  \	5      S9r
 S rS rS rS rSrg	)
r   x   zIConcrete :class:`Outcome` subclass representing a raised exception.

    )	validatorc                 $    SU R                   < S3$ )NzError(rB   )errorr    s    r   rD   Error.__repr__   rF   r$   c                 N    U R                  5         U R                  n Ue! AA f = frH   )r"   rS   )r!   captured_errors     r   r'   Error.unwrap   s-     	%   s     $c                 X    U R                  5         UR                  U R                  5      $ rH   )r"   throwrS   )r!   its     r   r-   
Error.send   s!    xx

##r$   c                 t   #    U R                  5         UR                  U R                  5      I S h  vN $  N7frH   )r"   athrowrS   r0   s     r   r2   Error.asend   s*     [[,,,,rN   r&   N)r4   r5   r6   r7   r8   r9   r:   
validatorsinstance_ofr   rS   rD   r'   r-   r2   r=   r&   r$   r   r   r   x   s=     GGdoo99-HIE)(%,$-r$   r   )r;   r9   _utilr   r   __all__r
   r	   sABCr   r   r   r&   r$   r   <module>re      s    
  5
> Ud+5cgg 5 ,5p t%t,,G , -,0 t%t,'-G '- -'-r$   