Title: [FEATURE] Add version deprecated information to PTB raised warnings · Issue #4261 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: [FEATURE] Add version deprecated information to PTB raised warnings · Issue #4261 · python-telegram-bot/python-telegram-bot
X Title: [FEATURE] Add version deprecated information to PTB raised warnings · Issue #4261 · python-telegram-bot/python-telegram-bot
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'...
Open Graph 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. ...
X 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. ...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/issues/4261
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FEATURE] Add version deprecated information to PTB raised warnings","articleBody":"### What kind of feature are you missing? Where do you notice a shortcoming of PTB?\r\n\r\nWe can slightly increase the information provided in warnings by adding which version the feature was deprecated in.\r\n\r\n### Describe the solution you'd like\r\n\r\n[Python's `warn()` ](https://docs.python.org/3.13/library/warnings.html#warnings.warn)accepts instances of `UserWarning`, so we can customize the message without repeating the phrase \"Deprecated in NEXT.VERSION\" everywhere.\r\n\r\nSteps:\r\n\r\n1. Add an argument `version` and `message` to `PTBDeprecationWarning`.\r\n2. Override `__str__` to add the phrase `\"Depreacted in {self.version}: {self.message}\"`\r\n\r\nOur call will now look like: \r\n```python\r\nPTBDeprecationWarning(\"NEXT.VERSION\", \"msg\")\r\n```\r\n### Describe alternatives you've considered\r\n\r\nSimply add the version information in the warning message, but then we'll have to keep repeating ourselves.\r\n\r\n### Additional context\r\n\r\nWe can also do the same for `PTBUserWarning` and `PTBRuntimeWarning`.","author":{"url":"https://github.com/harshil21","@type":"Person","name":"harshil21"},"datePublished":"2024-05-18T13:06:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/4261/python-telegram-bot/issues/4261"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c814325d-38e5-98b4-dab2-e249135c72c3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E388:73D73:10CE8F3:161F738:6A5BC70A |
| html-safe-nonce | fa8cadd3da752687063cedb94719e35f89b00190c06de13e5f67f57c75a74e91 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzg4OjczRDczOjEwQ0U4RjM6MTYxRjczODo2QTVCQzcwQSIsInZpc2l0b3JfaWQiOiI3ODk1NDU3MzMxNDE2OTA5NTc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a5d5669fee1a95af6eb76c8f4afe391035f3fb88507a166b24d26ff54eec6e1b |
| hovercard-subject-tag | issue:2304083882 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-telegram-bot/python-telegram-bot/4261/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f7acb551ac37805c9b6f6c4542764d224e07f9e215bd573511850bb8d44c87ef/python-telegram-bot/python-telegram-bot/issues/4261 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f7acb551ac37805c9b6f6c4542764d224e07f9e215bd573511850bb8d44c87ef/python-telegram-bot/python-telegram-bot/issues/4261 |
| og:image:alt | 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. ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | harshil21 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/python-telegram-bot/python-telegram-bot git https://github.com/python-telegram-bot/python-telegram-bot.git |
| octolytics-dimension-user_id | 16178365 |
| octolytics-dimension-user_login | python-telegram-bot |
| octolytics-dimension-repository_id | 38696925 |
| octolytics-dimension-repository_nwo | python-telegram-bot/python-telegram-bot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38696925 |
| octolytics-dimension-repository_network_root_nwo | python-telegram-bot/python-telegram-bot |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width