Repository navigation
Derby #2: Convert 115 sites to Argument Clinic in Modules/_cursesmodule.c #64370
Description
Activity
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 sitesTalk 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- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errorextension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancementand removedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Jan 7, 2014 I take it.
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.
-
All the Derby patches should only go into trunk at this point.
Updated to the tip. Unfortunately, Argument Clinic now generates incorrect parsing code for some functions. Tests are failed.
Fixed signatures generated with macro in _curses_panel.
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.panel3 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.
Should we close this issue or is anything left in this Derby?
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:
bugs.python.org fields: