L idZddlmZmZmZddlmZddlmZm Z de de de de d e f d Z d efd ed ede de de de de deee e fe ee gdfd efdZ dde de de de de d df dZy)zThis module contains functionality used for transition warnings issued by this library. It was created to prevent circular imports that would be caused by creating the warnings inside warnings.py. .. versionadded:: 20.2 )AnyCallableUnion)warn)PTBDeprecationWarningPTBUserWarningdeprecated_namenew_name object_typebot_api_versionreturnc ,d|d|d|d|d|d|d S)zBuilds a warning message for the transition in API when an object is renamed/replaced. Returns a warning message that can be used in `warn` function. zThe z 'z' was replaced by 'z ' in Bot API z. We recommend using 'z' instead of ''.r r r r s i/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_utils/warnings_transition.py!build_deprecation_warning_messager!s? {m2o..A(=  1(<  B deprecated_argnew_argdeprecated_arg_name new_arg_name ptb_version stacklevel warn_callbackNc |r*|r(||k7r#t||d|}td|d|d||r#|t|d|d|d|d |d z |S|S) aA helper function for the transition in API when argument is renamed. Checks the `deprecated_arg` and `new_arg` objects; warns if non-None `deprecated_arg` object was passed. Returns `new_arg` object (either the one originally passed by the user or the one that user passed as `deprecated_arg`). Raises `ValueError` if both `deprecated_arg` and `new_arg` objects were passed, and they are different. parameterrz"You passed different entities as 'z' and 'z'. Bot API z renamed the argument '' to 'rr)r ValueErrorr) rrrrr rrr base_messages r(warn_about_deprecated_arg_return_new_argr%4s&'n&?8/!#+  01D0EW\NZ]n    !?++BCVBWX >%  "A~   Nrdeprecated_attr_name new_attr_namec Ltt|d|d|d|d|dzy)zA helper function for the transition in API when attribute is renamed. Call from properties. The properties replace deprecated attributes in classes and issue these deprecation warnings. rz renamed the attribute 'r rr!r"N)rr)r&r'r rrs r&warn_about_deprecated_attr_in_propertyr)asC  ''?@T?UVb " > r)r)__doc__typingrrrtelegram._utils.warningsrtelegram.warningsrrstrrinttypeWarningr%r)rrrr2s&(')C   4VZ** ** *  *  **U3#67gLdRS* *d      r