FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-76007: Deprecate `__version__` attribute in `decimal` by StanFromIreland · Pull Request #140302 · python/cpython · GitHub

Repository navigation

gh-76007: Deprecate __version__ attribute in decimal - #140302

Merged
vstinner merged 10 commits into
python:mainfrom
StanFromIreland:decimal-version
Oct 26, 2025
Merged

vstinner merged 10 commits into
python:mainfrom
StanFromIreland:decimal-version

Conversation

StanFromIreland commented Oct 18, 2025 •
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

StanFromIreland marked this pull request as ready for review October 18, 2025 15:17
Comment thread Modules/_decimal/_decimal.c Outdated

Copy link
Copy Markdown
Member

cc @skirpichev @picnixz

Co-authored-by: Victor Stinner <vstinner@python.org>
Comment thread Doc/library/decimal.rst Outdated
Comment thread Lib/_pydecimal.py Outdated
Comment thread Lib/_pydecimal.py Outdated
Comment thread Modules/_decimal/_decimal.c Outdated
Comment thread Modules/_decimal/_decimal.c Outdated
Comment thread Lib/decimal.py

merwok commented Oct 19, 2025

Copy link
Copy Markdown
Member

(Please edit the commit message when merging so that we’re not tagged forever by pushes in clones! thanks 🙂)

StanFromIreland and others added 2 commits October 19, 2025 08:40
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>

StanFromIreland commented Oct 19, 2025 •
edited
Loading

Copy link
Copy Markdown
Member Author

(Please edit the commit message when merging so that we’re not tagged forever by pushes in clones! thanks 🙂)

Éric, all of my commits up to that point had the commit message "Commit"? I tagged you in the PR description, I don't think that should be a burden for longer than this PR is open? There is an "unsubscribe" button in the right sidebar.

Comment thread Modules/_decimal/_decimal.c Outdated
skirpichev requested a review from vstinner October 19, 2025 08:53

skirpichev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good, modulo one nitpick about decimal.rst.

I'm not sure also about naming for the constant. But lets see what other people think.

Comment thread Doc/library/decimal.rst Outdated

.. versionadded:: 3.8.3

.. data:: SPEC_VERSION

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hmm, I think that this should be moved up before "The constants in this section are only relevant for the C module." sentence of the first paragraph. Which should be also rephrased, i.e. "Following constants in <...>". Clearly, spec version is relevant for both modules.

BTW, I'm not sure about naming. Maybe more verbose "DECIMAL_SPEC_VERSION"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

BTW, I'm not sure about naming. Maybe more verbose "DECIMAL_SPEC_VERSION"?

I have a similar sentiment, I simply used this since it was in the discussion.

Copy link
Copy Markdown
Member

all of my commits up to that point had the commit message "Commit"? I tagged you in the PR description

It seems core devs sometimes use PR descriptions for commit messages. So, it's rather a reminder for one, who will merge this pr.

hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm not sure also about naming for the constant. But lets see what other people think.

decimal.SPEC_VERSION is fine by me. Skip also suggested it at #76007 (comment).

Comment thread Doc/whatsnew/3.15.rst Outdated
Comment thread Lib/_pydecimal.py Outdated
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
vstinner merged commit 00026d1 into python:main Oct 26, 2025
45 checks passed

Copy link
Copy Markdown
Member

Merged, thank you.

StanFromIreland deleted the decimal-version branch October 26, 2025 11:06

Copy link
Copy Markdown
Member

Oh, importing decimal does now emit a DeprecationWarning:

$ ./python -Werror -c "import decimal"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import decimal
  File "/home/vstinner/python/main/Lib/decimal.py", line 103, in <module>
    from _decimal import __version__  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DeprecationWarning: '__version__' is deprecated and slated for removal in Python 3.20

vstinner commented Oct 28, 2025 •
edited
Loading

Copy link
Copy Markdown
Member

Oh, ignore my previous comment, I forgot to run make when testing an old PR :-)

StanFromIreland added a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
…n#140302)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL