Skip to content
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

Fix outdated bytes comments #86597

Closed
serhiy-storchaka opened this issue Nov 22, 2020 · 4 comments
Closed

Fix outdated bytes comments #86597

serhiy-storchaka opened this issue Nov 22, 2020 · 4 comments
Labels
3.10 interpreter-core

Comments

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Nov 22, 2020

BPO 42431
Nosy @vstinner, @serhiy-storchaka
PRs
  • #23458
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-12-03.10:46:40.319>
    created_at = <Date 2020-11-22.09:38:12.751>
    labels = ['interpreter-core', '3.10']
    title = 'Fix outdated bytes comments'
    updated_at = <Date 2020-12-03.10:46:40.318>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-12-03.10:46:40.318>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-12-03.10:46:40.319>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2020-11-22.09:38:12.751>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42431
    keywords = ['patch']
    message_count = 4.0
    messages = ['381604', '381660', '381661', '382400']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'serhiy.storchaka']
    pr_nums = ['23458']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue42431'
    versions = ['Python 3.10']

    @serhiy-storchaka
    Copy link
    Member Author

    @serhiy-storchaka serhiy-storchaka commented Nov 22, 2020

    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.

    @serhiy-storchaka serhiy-storchaka added 3.10 interpreter-core labels Nov 22, 2020
    @vstinner
    Copy link
    Member

    @vstinner vstinner commented Nov 23, 2020

    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.

    @vstinner
    Copy link
    Member

    @vstinner vstinner commented Nov 23, 2020

    (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.

    @serhiy-storchaka
    Copy link
    Member Author

    @serhiy-storchaka serhiy-storchaka commented Dec 3, 2020

    New changeset 2ad9382 by Serhiy Storchaka in branch 'master':
    bpo-42431: Fix outdated bytes comments (GH-23458)
    2ad9382

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 interpreter-core
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants