Skip to content

Add SoftDeprecationWarning warning category #106137

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

Closed
vstinner opened this issue Jun 27, 2023 · 4 comments
Closed

Add SoftDeprecationWarning warning category #106137

vstinner opened this issue Jun 27, 2023 · 4 comments
Labels
type-feature A feature request or enhancement

Comments

@vstinner
Copy link
Member

vstinner commented Jun 27, 2023

Implementation of my proposed PEP 387 "Soft Deprecation" policy: python/peps#3182

As an example, I propose to soft deprecate the getopt module: PR #105735 (currently, the PR uses a regular "hard" deprecation).

Linked PRs

@vstinner vstinner added the type-bug An unexpected behavior, bug, or error label Jun 27, 2023
vstinner added a commit to vstinner/cpython that referenced this issue Jun 27, 2023
* Add SoftDeprecationWarning warning category.
* Add default warnings filters for SoftDeprecationWarning: ignore
  SoftDeprecationWarning by default, except in the __main__ module
  (similar to PEP 565).
* Add warnings._soft_deprecated(): only emit SoftDeprecationWarning
  in Python Development Mode and if Python is built in debug mode.
* Add PyExc_SoftDeprecationWarning to the limited C API.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 27, 2023
* Add SoftDeprecationWarning warning category.
* Add default warnings filters for SoftDeprecationWarning: ignore
  SoftDeprecationWarning by default, except in the __main__ module
  (similar to PEP 565).
* Add warnings._soft_deprecated(): only emit SoftDeprecationWarning
  in Python Development Mode and if Python is built in debug mode.
* Add PyExc_SoftDeprecationWarning to the limited C API.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 27, 2023
* Add SoftDeprecationWarning warning category.
* Add default warnings filters for SoftDeprecationWarning: ignore
  SoftDeprecationWarning by default, except in the __main__ module
  (similar to PEP 565).
* Add warnings._soft_deprecated(): only emit SoftDeprecationWarning
  in Python Development Mode and if Python is built in debug mode.
* Add PyExc_SoftDeprecationWarning to the limited C API.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 27, 2023
* Add SoftDeprecationWarning warning category.
* Add default warnings filters for SoftDeprecationWarning: ignore
  SoftDeprecationWarning by default, except in the __main__ module
  (similar to PEP 565).
* Add warnings._soft_deprecated(): only emit SoftDeprecationWarning
  in Python Development Mode and if Python is built in debug mode.
* Add PyExc_SoftDeprecationWarning to the limited C API.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 27, 2023
* Add SoftDeprecationWarning warning category.
* Add default warnings filters for SoftDeprecationWarning: ignore
  SoftDeprecationWarning by default, except in the __main__ module
  (similar to PEP 565).
* Add warnings._soft_deprecated(): only emit SoftDeprecationWarning
  in Python Development Mode and if Python is built in debug mode.
* Add PyExc_SoftDeprecationWarning to the limited C API.
@terryjreedy
Copy link
Member

This seems like a new feature. Is there any discussion that you can link to? Such as about the PEP?

@AlexWaygood AlexWaygood added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Jun 27, 2023
@vstinner
Copy link
Member Author

This seems like a new feature. Is there any discussion that you can link to? Such as about the PEP?

Yes, see the first link in the issue :-)

Implementation of my proposed PEP 387 "Soft Deprecation" policy: python/peps#3182

=> python/peps#3182

Also, @hugovk gave the link to the discussion.

vstinner added a commit to vstinner/cpython that referenced this issue Jun 27, 2023
* Add SoftDeprecationWarning warning category.
* Add default warnings filters for SoftDeprecationWarning: ignore
  SoftDeprecationWarning by default, except in the __main__ module
  (similar to PEP 565).
* Add warnings._soft_deprecated(): only emit SoftDeprecationWarning
  in Python Development Mode and if Python is built in debug mode.
* Add PyExc_SoftDeprecationWarning to the limited C API.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 28, 2023
* Add SoftDeprecationWarning warning category.
* Add default warnings filters for SoftDeprecationWarning: ignore
  SoftDeprecationWarning by default, except in the __main__ module
  (similar to PEP 565).
* Add warnings._soft_deprecated(): only emit SoftDeprecationWarning
  in Python Development Mode and if Python is built in debug mode.
* Add PyExc_SoftDeprecationWarning to the limited C API.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 28, 2023
* Add SoftDeprecationWarning warning category.
* Add default warnings filters for SoftDeprecationWarning: ignore
  SoftDeprecationWarning by default, except in the __main__ module
  (similar to PEP 565).
* Add warnings._soft_deprecated(): only emit SoftDeprecationWarning
  in Python Development Mode and if Python is built in debug mode.
* Add PyExc_SoftDeprecationWarning to the limited C API.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 28, 2023
* Add SoftDeprecationWarning warning category.
* Add default warnings filters for SoftDeprecationWarning: ignore
  SoftDeprecationWarning by default, except in the __main__ module
  (similar to PEP 565).
* Add warnings._soft_deprecated(): only emit SoftDeprecationWarning
  in Python Development Mode and if Python is built in debug mode.
* Add PyExc_SoftDeprecationWarning to the limited C API.
@vstinner
Copy link
Member Author

The idea of issuing a warning for soft deprecations is not liked, so I abandon my idea: https://discuss.python.org/t/formalize-the-concept-of-soft-deprecation-dont-schedule-removal-in-pep-387-backwards-compatibility-policy/27957

@arhadthedev arhadthedev closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

5 participants