Skip to content

Conversation

harshil21
Copy link
Member

@harshil21 harshil21 commented Sep 16, 2021

Closes #2467

Notes:

  • Made Telegram{User, Deprecation}Warning public and is accessible by telegram.utils.deprecate. We can change it later depending on Clear up imports policy #2468. Edit: Review now made it accessible via telegram.utils.warnings

  • some warnings don't have stacklevels because they take place in another thread so its not possible to get the caller

  • update some warning messages to be more descriptive.

@harshil21 harshil21 added enhancement 🛠 breaking change type: breaking labels Sep 16, 2021
@harshil21 harshil21 added this to the v14 milestone Sep 16, 2021
Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far! Comments:

  • Even if import policy is changed in #2468, we should probably rename utils.deprecate to utils.warnings already since that file is now no longer exclusively for deprecation
  • Just a thought: Maybe it's worth adding a function utils.warnings.warn, which acts as a shortcut for warnings.warn with a default category=TelegramUserWarning?
  • Another thought: Maybe PTB*Warning is better than TG*Warning b/c the warnings are issued by PTB and not by TG?

@Bibo-Joshi Bibo-Joshi added the 📋 pending-reply work status: pending-reply label Sep 19, 2021
@Bibo-Joshi Bibo-Joshi mentioned this pull request Sep 19, 2021
4 tasks
@harshil21 harshil21 removed the 📋 pending-reply work status: pending-reply label Sep 19, 2021
@Bibo-Joshi Bibo-Joshi merged commit 66f0604 into v14 Sep 20, 2021
@Bibo-Joshi Bibo-Joshi deleted the warnings-overhaul branch September 20, 2021 06:45
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2021
@Bibo-Joshi Bibo-Joshi added 🔌 enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🛠 breaking change type: breaking 🔌 enhancement pr description: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants