
    'i                     ,   U d Z ddlmZmZmZ  ede      Z ede      Z G d dee         Z ed      Z	ed   e
d	<   	  ed
      Zee   e
d<   	  ed      Zee   e
d<   	  ed      Zee   e
d<   	  ed      Zee   e
d<   	  ed      Zee   e
d<   y)a  This module contains the DefaultValue class.

.. versionchanged:: 20.0
   Previously, the contents of this module were available through the (no longer existing)
   module ``telegram._utils.helpers``.

Warning:
    Contents of this module are intended to be used internally by the library and *not* by the
    user. Changes to this module are not considered breaking changes and may not be documented in
    the changelog.
    )GenericTypeVaroverloadDVType)boundOTc                       e Zd ZdZdZdefdZdefdZde	fdZ
de	fdZeed	d
defd              Zeed	edefd              Zed	ddefd       Zy)DefaultValueau  Wrapper for immutable default arguments that allows to check, if the default value was set
    explicitly. Usage::

        default_one = DefaultValue(1)
        def f(arg=default_one):
            if arg is default_one:
                print('`arg` is the default')
                arg = arg.value
            else:
                print('`arg` was set explicitly')
            print(f'`arg` = {str(arg)}')

    This yields::

        >>> f()
        `arg` is the default
        `arg` = 1
        >>> f(1)
        `arg` was set explicitly
        `arg` = 1
        >>> f(2)
        `arg` was set explicitly
        `arg` = 2

    Also allows to evaluate truthiness::

        default = DefaultValue(value)
        if default:
            ...

    is equivalent to::

        default = DefaultValue(value)
        if value:
            ...

    ``repr(DefaultValue(value))`` returns ``repr(value)`` and ``str(DefaultValue(value))`` returns
    ``f'DefaultValue({value})'``.

    Args:
        value (:class:`object`): The value of the default argument
    Attributes:
        value (:class:`object`): The value of the default argument

    valuer   c                     || _         y Nr   )selfr   s     f/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/telegram/_utils/defaultvalue.py__init__zDefaultValue.__init__V   s	    "
    returnc                 ,    t        | j                        S r   )boolr   r   s    r   __bool__zDefaultValue.__bool__Y       DJJr   c                 "    d| j                    dS )NzDefaultValue()r   r   s    r   __str__zDefaultValue.__str__]   s    tzzl!,,r   c                 ,    t        | j                        S r   )reprr   r   s    r   __repr__zDefaultValue.__repr__a   r   r   objzDefaultValue[OT]c                      y r    r   s    r   	get_valuezDefaultValue.get_valued   s    25r   c                      y r   r!   r"   s    r   r#   zDefaultValue.get_valueh   s    "%r   zOT | DefaultValue[OT]c                 >    t        | t              r| j                  S | S )zShortcut for::

            return obj.value if isinstance(obj, DefaultValue) else obj

        Args:
            obj (:obj:`object`): The object to process

        Returns:
            Same type as input, or the value of the input: The value
        )
isinstancer
   r   r"   s    r   r#   zDefaultValue.get_valuel   s     'sL9syyBsBr   N)__name__
__module____qualname____doc__	__slots__r   r   r   r   strr   r   r   staticmethodr   r#   r!   r   r   r
   r
   %   s    ,\ I#f # $  - - #   5)5b5  5%r%b%  %C. C2 C Cr   r
   NDEFAULT_NONEFDEFAULT_FALSETDEFAULT_TRUE   
DEFAULT_20z	127.0.0.1
DEFAULT_IPP   
DEFAULT_80)r*   typingr   r   r   objectr   r   r
   r.   __annotations__r/   r   r0   r2   intr3   r,   r5   r!   r   r   <module>r:      s   &
 . -		(T SC76? SCl $0#5l4  5 0$0$7|D! 7 1#/#5l4  5 !-R 0
L 0 . ,[ 9
L 9
 !-R 0
L 0r   