This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Remove a vague statement in documentation of Integer Objects
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, ericvw, rhettinger, sgalal
Priority: normal Keywords: patch

Created on 2019-07-15 20:39 by sgalal, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 14786 merged sgalal, 2019-07-15 20:46
Messages (3)
msg347990 - (view) Author: sgalal (sgalal) * Date: 2019-07-15 20:39
In current Python document (3.7 - 3.9) there is such statement in documentation of Integer Objects:

The current implementation keeps an array of integer objects for all integers between ``-5`` and ``256``, when you create an int in that range you actually just get back a reference to the existing object. So it should be possible to change the value of ``1``.  I suspect the behaviour of Python in this case is undefined. :-)

The last sentence is vague. It is irresponsible to write "I suspect" in documentation. And as the statements ahead has already clarified the sense that this is "a current implementation", the last sentence should be removed.
msg348019 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-07-16 14:57
There's nothing wrong with a little wry humor in the docs, especially when the provide a little insight into the implementation.  It isn't irresponsible at all -- please avoid those pejoratives.

That said, I'll accept the patch because the sentence isn't necessary and has other issues (the statement makes more sense in the ctypes module where such changes are possible and it applies broadly to all immutable objects, not just pre-computed singleton integers).
msg348021 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-07-16 15:15
New changeset 1d8b04edfdc3030e645730492bfcc27b75718b96 by Raymond Hettinger (sgal) in branch 'master':
bpo-37599: Remove a vague statement in documentation of Integer Objects (#14786)
https://github.com/python/cpython/commit/1d8b04edfdc3030e645730492bfcc27b75718b96
History
Date User Action Args
2022-04-11 14:59:18adminsetgithub: 81780
2019-07-16 15:16:14rhettingersetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: - Python 3.7, Python 3.8
2019-07-16 15:15:23rhettingersetmessages: + msg348021
2019-07-16 14:57:06rhettingersetnosy: + rhettinger
messages: + msg348019
2019-07-15 20:46:29sgalalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request14583
2019-07-15 20:41:14ericvwsetnosy: + ericvw
2019-07-15 20:39:43sgalalcreate