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: Fix outdated bytes comments
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2020-11-22 09:38 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 23458 merged serhiy.storchaka, 2020-11-22 09:41
Messages (4)
msg381604 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-11-22 09:38
Some comments in C code still refer to bytearray object as bytes object and to bytes object as string object.

The proposed PR fixes outdated comments.

It also moves the definition of macros F_LJUST etc from public header to private header. They are only used internally and never leaked to the user. They were defined in two places: in Include/bytesobject.h and Objects/bytesobject.c.

Is it true that headers in Include/internal are more private than headers in Include/cpython? It is not clear from names.
msg381660 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-11-23 09:36
> Is it true that headers in Include/internal are more private than headers in Include/cpython? It is not clear from names.

You cannot include an header file from Include/internal by default. All internal header files are guarded with:

#ifndef Py_BUILD_CORE
#  error "this header requires Py_BUILD_CORE define"
#endif

A C extension must define Py_BUILD_CORE macro or variant to include such header file. There is no intent to tehcnically prevent to include a header file, only an header to warn users that you should not do that unless they understand what they do.
msg381661 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-11-23 09:38
(Sorry, I need more coffee. New attempt.)

A C extension must define Py_BUILD_CORE macro or variant to include such header file. There is no intent to technically prevent to include a header file, only an intent to warn users that they should not do that unless they understand what they do.
msg382400 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-12-03 10:46
New changeset 2ad93821a69e6efac3b0efe1d205d6e5ef030791 by Serhiy Storchaka in branch 'master':
bpo-42431: Fix outdated bytes comments (GH-23458)
https://github.com/python/cpython/commit/2ad93821a69e6efac3b0efe1d205d6e5ef030791
History
Date User Action Args
2022-04-11 14:59:38adminsetgithub: 86597
2020-12-03 10:46:40serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-12-03 10:46:20serhiy.storchakasetmessages: + msg382400
2020-11-23 09:38:35vstinnersetmessages: + msg381661
2020-11-23 09:36:37vstinnersetmessages: + msg381660
2020-11-22 09:41:25serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request22350
2020-11-22 09:38:12serhiy.storchakacreate