Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add stacklevel parameter to set_new_attribute_deprecated #2574

Merged
merged 2 commits into from
Jun 29, 2021

Conversation

harshil21
Copy link
Member

@harshil21 harshil21 commented Jun 26, 2021

Adds the stacklevel parameter and details the warning message to set_new_attribute_deprecated so users can pinpoint where the warning originates from.

In response to https://t.me/pythontelegrambotgroup/491855

@Bibo-Joshi Bibo-Joshi self-requested a review June 28, 2021 06:59
@Bibo-Joshi
Copy link
Member

Ran a small test and noticed that it says e.g. "objects such as 'User'" instead of "objects such as 'telegram.User'" and for filters it will report name of the private class we use. I can live with both given that this warning will only be removed eventually and the latter is quite the edge case imo. Just wanted to note this before we go for merging … :)

Copy link
Member Author

@Bibo-Joshi Yep, the user would mostly likely understand which line the warning came from in either case

@Bibo-Joshi Bibo-Joshi merged commit fce2993 into master Jun 29, 2021
@Bibo-Joshi Bibo-Joshi deleted the add-stacklevel branch June 29, 2021 16:10
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants