o
    /hr
                     @   s   d Z ddlZddlZddlmZmZmZ edZedZ	edej
dZdee d	ed
e	deeee	f fddZG dd deej
ZG dd dejZdS )a  This module contains helper functions related to enums.

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.
    N)TypeTypeVarUnion_A_B_Enum)boundenum_clsvaluedefaultreturnc                 C   s"   z| |W S  t y   | Y S w )zTries to call ``enum_cls(value)`` to convert the value into an enumeration member.
    If that fails, the ``default`` is returned.
    )
ValueError)r	   r
   r    r   M/var/www/html/govbot/env/lib/python3.10/site-packages/telegram/_utils/enum.py
get_member#   s
   
r   c                   @   s0   e Zd ZdZdZdefddZdefddZdS )	
StringEnumzHelper class for string enums where ``str(member)`` prints the value, but ``repr(member)``
    gives ``EnumName.MEMBER_NAME``.
    r   r   c                 C      d| j j d| j dS N<.>	__class____name__nameselfr   r   r   __repr__7      zStringEnum.__repr__c                 C   s
   t | S N)str__str__r   r   r   r   r!   :      
zStringEnum.__str__N)r   
__module____qualname____doc__	__slots__r    r   r!   r   r   r   r   r   0   s
    r   c                   @   s>   e Zd ZdZdZdefddZejdk rdefddZ	d	S d	S )
IntEnumzHelper class for int enums where ``str(member)`` prints the value, but ``repr(member)``
    gives ``EnumName.MEMBER_NAME``.
    r   r   c                 C   r   r   r   r   r   r   r   r   F   r   zIntEnum.__repr__)      c                 C   s
   t | jS r   )r    r
   r   r   r   r   r!   K   r"   zIntEnum.__str__N)
r   r#   r$   r%   r&   r    r   sysversion_infor!   r   r   r   r   r'   ?   s    
r'   )r%   enum_enumr*   typingr   r   r   r   r   Enumr   r   r    r   r'   r   r   r   r   <module>   s   (