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

Convert the remaining os funtions to Argument Clinic #84359

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

Convert the remaining os funtions to Argument Clinic #84359

serhiy-storchaka opened this issue Apr 4, 2020 · 4 comments
Labels
3.9 only security fixes extension-modules C modules in the Modules dir topic-argument-clinic type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 40178
Nosy @terryjreedy, @larryhastings, @serhiy-storchaka
PRs
  • bpo-40178: Convert the remaining os functions to Argument Clinic. #19360
  • 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-05-07.18:14:29.008>
    created_at = <Date 2020-04-04.12:25:08.411>
    labels = ['extension-modules', 'type-feature', 'expert-argument-clinic', '3.9']
    title = 'Convert the remaining os funtions to Argument Clinic'
    updated_at = <Date 2020-05-07.18:14:29.007>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-05-07.18:14:29.007>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-07.18:14:29.008>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules', 'Argument Clinic']
    creation = <Date 2020-04-04.12:25:08.411>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40178
    keywords = ['patch']
    message_count = 4.0
    messages = ['365762', '365763', '366148', '366725']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'larry', 'serhiy.storchaka']
    pr_nums = ['19360']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue40178'
    versions = ['Python 3.9']

    @serhiy-storchaka
    Copy link
    Member Author

    The proposed PR converts os.getgrouplist(), os.initgroups(), os.sendfile() and os.get_terminal_size() to Argument Clinic.

    @serhiy-storchaka serhiy-storchaka added 3.9 only security fixes extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels Apr 4, 2020
    @serhiy-storchaka
    Copy link
    Member Author

    The problems which prevented their conversions before (in bpo-20170):

    1. os.sendfile() had parameter names conflicting with Python keywords. Was solved in bpo-38378.

    2. os.get_terminal_size() has an optional argument without default value. It was solved in a way similar to bpo-37206.

    3. Some functions have platform-specific types of arguments. os.sendfile() has additional parameters. It was solved by using a preprocessor. We need to repeat most of the declaration and docstring, but it is the best that we can have now.

    @terryjreedy
    Copy link
    Member

    bpo-37206 changed the signature "pop(self, key, default=None, /)" back to "D.pop(k[,d]) -> v", taken from dict.pop.__doc__. However, the incorrect version that got reverted correctly added the positional-only indicator '/'. Docstrings with signatures for such cases may need updating.

    Unlike most objects with invalid signatures (as seen by inspect.signature), the current docstring for os.get_terminal_size does not have a backup signature for help (and IDLE) to present. I cannot tell if the patch adds it.

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 2b56031 by Serhiy Storchaka in branch 'master':
    bpo-40178: Convert the remaining os functions to Argument Clinic. (GH-19360)
    2b56031

    @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.9 only security fixes extension-modules C modules in the Modules dir topic-argument-clinic type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants