L i0UdZddlmZmZmZmZedeZedeZGddeeZ e dZ e de d < e d Z e e e d < e d Ze e e d < e dZe ee d< e dZe ee d< e dZe ee d<y)aThis 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. )GenericTypeVarUnionoverloadDVType)boundOTceZdZdZdZdefdZdefdZde fdZ de fdZ e e d d defd Ze e d edefd Ze d eed fdefd Zy) DefaultValueauWrapper 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||_yNr )selfr s b/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_utils/defaultvalue.py__init__zDefaultValue.__init__Vs " returnc,t|jSr)boolr rs r__bool__zDefaultValue.__bool__YDJJrc"d|jdS)Nz DefaultValue()r rs r__str__zDefaultValue.__str__]stzzl!,,rc,t|jSr)reprr rs r__repr__zDefaultValue.__repr__arrobjzDefaultValue[OT]cyrr s r get_valuezDefaultValue.get_valueds25rcyrr"r#s rr$zDefaultValue.get_valuehs"%rc>t|tr |jS|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 rr$zDefaultValue.get_valuels'sL9syyBsBrN)__name__ __module__ __qualname____doc__ __slots__rrrrstrrrr staticmethodr r$rr"rrr r %s,\I#f# $ -- # 5)5b55 %r%b%% CuR!334 C C Crr N DEFAULT_NONEF DEFAULT_FALSET DEFAULT_TRUE DEFAULT_20z 127.0.0.1 DEFAULT_IPP DEFAULT_80)r+typingrrrrobjectrr r r/__annotations__r0rr1r3intr4r-r6r"rrr;s& 54  ( T SC76?SCl$0#5 l4 50$0$7 |D!71#/#5 l4 5 !-R 0 L 0. ,[ 9 L 9 !-R 0 L 0r