Skip to content

Derby #2: Convert 115 sites to Argument Clinic in Modules/_cursesmodule.c #64370

Description

@larryhastings
BPO 20171
Nosy @larryhastings, @serhiy-storchaka, @pablogsal
PRs
  • bpo-20171: Convert the _curses and _curses_panel modules to Argument Clinic. #4251
  • Files
  • curses_clinic.patch
  • curses_clinic_2.patch
  • curses_clinic_3.patch
  • 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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2020-07-10.18:51:04.201>
    created_at = <Date 2014-01-07.23:43:56.780>
    labels = ['extension-modules', 'type-feature', '3.7', 'expert-argument-clinic']
    title = 'Derby #2: Convert 115 sites to Argument Clinic in Modules/_cursesmodule.c'
    updated_at = <Date 2020-07-10.18:51:04.201>
    user = 'https://github.com/larryhastings'

    bugs.python.org fields:

    activity = <Date 2020-07-10.18:51:04.201>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2020-07-10.18:51:04.201>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules', 'Argument Clinic']
    creation = <Date 2014-01-07.23:43:56.780>
    creator = 'larry'
    dependencies = []
    files = ['33567', '39293', '39294']
    hgrepos = []
    issue_num = 20171
    keywords = ['patch']
    message_count = 9.0
    messages = ['207616', '208408', '208555', '224754', '242594', '242595', '305475', '316352', '332733']
    nosy_count = 3.0
    nosy_names = ['larry', 'serhiy.storchaka', 'pablogsal']
    pr_nums = ['4251']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue20171'
    versions = ['Python 3.7']

    Activity

    1. larryhastings commented on Jan 7, 2014

      @larryhastings
      ContributorAuthor

      This issue is part of the Great Argument Clinic Conversion Derby,
      where we're trying to convert as much of Python 3.4 to use
      Argument Clinic as we can before Release Candidate 1 on January 19.

      This issue asks you to change the following bundle of files:
      Modules/_cursesmodule.c: 115 sites

      Talk to me (larry) if you only want to attack part of a bundle.

      For instructions on how to convert a function to work with Argument
      Clinic, read the "howto":
      http://docs.python.org/dev/howto/clinic.html

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      type-featureA feature request or enhancement
      and removed
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Jan 7, 2014
    3. serhiy-storchaka commented on Jan 18, 2014

      @serhiy-storchaka
      Member

      I take it.

    4. serhiy-storchaka commented on Jan 20, 2014

      @serhiy-storchaka
      Member

      Here is half-baked (just for demonstration) patch for the _curses and _curses_panel modules.

      Known issues:

      • The chgat, getstr, and instr methods have signatures which can't be processed by current Argument Clinic (bpo-20303).

      • Signatures of the noutrefresh and refresh methods depends on compile-time options.

      • Many other functions are defined optionally. But the #ifdef trick doesn't work with side file destination.

      • A lot of functions are generated by preprocessor. We can't use Argument Clinic for them (if not increase the volume of code too much). I think preprocessor should be used to generate docstrings with signature (done in the _curses_panel module).

      • Functions in these modules have not docstrings at all. I try to add docstrings (simplified descriptions from the documentation file), but may be we should do this in separate issue.

      I have temporary added the window class to the _curses module and the panel classes to the _curses_panel modules. Now you can examine docstrings of _curses.window and _curses_panel.panel with pydoc.

    5. larryhastings commented on Aug 4, 2014

      @larryhastings
      ContributorAuthor

      All the Derby patches should only go into trunk at this point.

    6. serhiy-storchaka commented on May 5, 2015

      @serhiy-storchaka
      Member

      Updated to the tip. Unfortunately, Argument Clinic now generates incorrect parsing code for some functions. Tests are failed.

    7. serhiy-storchaka commented on May 5, 2015

      @serhiy-storchaka
      Member

      Fixed signatures generated with macro in _curses_panel.

    8. serhiy-storchaka commented on Nov 3, 2017

      @serhiy-storchaka
      Member

      PR 4251 converts most of functions in the _curses and _curses_panel modules (around 130 functions) to Argument Clinic. Many functions didn't have docstrings, the PR adds them. You can test new signatures and docstrings by the following commands:

      ./python -m pydoc curses
      ./python -m pydoc curses.window
      ./python -m pydoc curses.panel
      ./python -m pydoc curses.panel.panel

      3 functions can't be converted. The initial versions of Argument Clinic supported such declarations, but now it doesn't support them. Will try to fix Argument Clinic in other issue. Yet 35 generated window methods have not been converted because I'm too tired by this patch. They will be converted by other patches.

      I tried to make new and existing docstrings short and clear, but I think many docstrings still need editing.

    9. serhiy-storchaka commented on May 10, 2018

      @serhiy-storchaka
      Member

      New changeset b00854c by Serhiy Storchaka in branch 'master':
      bpo-20171: Convert the _curses and _curses_panel modules to Argument Clinic. (GH-4251)
      b00854c

    10. pablogsal commented on Dec 29, 2018

      @pablogsal
      Member

      Should we close this issue or is anything left in this Derby?

    11. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions