L i dZddlZddlZddlmZmZedZedZedejZ de e d ed ed ee eeffd Z Gd de ejZGddejZGddeejZy)aThis 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)TypeVarUnion_A_B_Enum)boundenum_clsvaluedefaultreturnc6 ||S#t$r|cYSwxYw)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 s Z/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_utils/enum.py get_memberr$s% s  c,eZdZdZdZdefdZdefdZy) StringEnumzHelper class for string enums where ``str(member)`` prints the value, but ``repr(member)`` gives ``EnumName.MEMBER_NAME``. r cPd|jjd|jdSN<.> __class____name__nameselfs r__repr__zStringEnum.__repr__8&4>>**+1TYYKq99c,tj|SN)str__str__rs rr%zStringEnum.__str__;s{{4  r!Nr __module__ __qualname____doc__ __slots__r$rr%rr!rrr1s&I:#:!!r!rcLeZdZdZdZdefdZejdkrdefdZ yy)IntEnumzHelper class for int enums where ``str(member)`` prints the value, but ``repr(member)`` gives ``EnumName.MEMBER_NAME``. rr cPd|jjd|jdSrrrs rrzIntEnum.__repr__Gr r!) c,t|jSr#r$r rs rr%zIntEnum.__str__Lstzz? "r!N) rr'r(r)r*r$rsys version_infor%rr!rr,r,@s;I:#: '! #S #"r!r,c,eZdZdZdZdefdZdefdZy) FloatEnumzHelper class for float enums where ``str(member)`` prints the value, but ``repr(member)`` gives ``EnumName.MEMBER_NAME``. rr cPd|jjd|jdSrrrs rrzFloatEnum.__repr__Wr r!c,t|jSr#r1rs rr%zFloatEnum.__str__Zs4::r!Nr&rr!rr5r5Ps&I:#:r!r5)r)enum_enumr2typingrrrrEnumrtyperr$rr,floatr5rr!rr>s& ! T] T]uzz*eR"ubRT}AU !ejj ! #emm # uzz r!