-
-
Notifications
You must be signed in to change notification settings - Fork 33k
gh-76007: Deprecate __version__
attribute
#138675
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
38e19bd
Deprecate __version__ attribute
hugovk c23ee78
Update SBOM checksums for Lib/ctypes/macholib/__init__.py
hugovk 6e01534
Whitespace
hugovk ddb6a2b
Merge branch 'main' into 3.15-deprecate__version__
hugovk 7b13a13
Deprecate for recommended five years
hugovk bfbe4b7
Deprecate for recommended five years
hugovk 6bb4cbe
Deprecate for recommended five years
hugovk d352594
Re-update SBOM checksums for Lib/ctypes/macholib/__init__.py
hugovk d17235d
Fix Sphinx
hugovk 134c8be
Fix Sphinx
hugovk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Pending removal in Python 3.20 | ||
------------------------------ | ||
|
||
* The ``__version__`` attribute has been deprecated in these standard library | ||
modules and will be removed in Python 3.20. | ||
Use :py:data:`sys.version_info` instead. | ||
|
||
- :mod:`argparse` | ||
- :mod:`csv` | ||
- :mod:`!ctypes.macholib` | ||
- :mod:`ipaddress` | ||
- :mod:`json` | ||
- :mod:`logging` (``__date__`` also deprecated) | ||
- :mod:`optparse` | ||
- :mod:`pickle` | ||
- :mod:`platform` | ||
- :mod:`re` | ||
- :mod:`socketserver` | ||
- :mod:`tabnanny` | ||
- :mod:`tkinter.font` | ||
- :mod:`tkinter.ttk` | ||
|
||
(Contributed by Hugo van Kemenade in :gh:`76007`.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,9 +45,6 @@ | |
|
||
__author__ = "Vinay Sajip <[email protected]>" | ||
__status__ = "production" | ||
# The following module attributes are no longer updated. | ||
__version__ = "0.5.1.2" | ||
__date__ = "07 February 2010" | ||
|
||
#--------------------------------------------------------------------------- | ||
# Miscellaneous module data | ||
|
@@ -2341,3 +2338,16 @@ def captureWarnings(capture): | |
if _warnings_showwarning is not None: | ||
warnings.showwarning = _warnings_showwarning | ||
_warnings_showwarning = None | ||
|
||
|
||
def __getattr__(name): | ||
if name in ("__version__", "__date__"): | ||
from warnings import _deprecated | ||
|
||
_deprecated(name, remove=(3, 20)) | ||
return { # Do not change | ||
"__version__": "0.5.1.2", | ||
"__date__": "07 February 2010", | ||
}[name] | ||
|
||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
|
||
Misc variables: | ||
|
||
__version__ | ||
format_version | ||
compatible_formats | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this will show the same list twice in this page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's how we're already doing it for other ones (I'm not sure if we should, but that's another discussion).