-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Copy link
Description
What kind of feature are you missing? Where do you notice a shortcoming of PTB?
We can slightly increase the information provided in warnings by adding which version the feature was deprecated in.
Describe the solution you'd like
Python's warn() accepts instances of UserWarning, so we can customize the message without repeating the phrase "Deprecated in NEXT.VERSION" everywhere.
Steps:
- Add an argument
versionandmessagetoPTBDeprecationWarning. - Override
__str__to add the phrase"Depreacted in {self.version}: {self.message}"
Our call will now look like:
PTBDeprecationWarning("NEXT.VERSION", "msg")Describe alternatives you've considered
Simply add the version information in the warning message, but then we'll have to keep repeating ourselves.
Additional context
We can also do the same for PTBUserWarning and PTBRuntimeWarning.
Metadata
Metadata
Assignees
Labels
No labels