Skip to content

Derby #7: Convert 51 sites to Argument Clinic across 3 files -> Derby: Convert the ElementTree module to use Argument Clinic #64358

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

Closed
serhiy-storchaka opened this issue Jan 7, 2014 · 14 comments
Labels
extension-modules C modules in the Modules dir topic-argument-clinic topic-XML type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 20159
Nosy @scoder, @larryhastings
Dependencies
  • bpo-20141: Argument Clinic: broken support for 'O!'
  • bpo-20157: Argument Clinic generates wrong keyword parameter name for "default"
  • Files
  • etree_clinic.patch
  • etree_clinic_2.patch
  • etree_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 = None
    closed_at = None
    created_at = <Date 2014-01-07.09:29:26.417>
    labels = ['extension-modules', 'expert-XML', 'type-feature', 'expert-argument-clinic']
    title = 'Derby #7: Convert 51 sites to Argument Clinic across 3 files -> Derby: Convert the ElementTree module to use Argument Clinic'
    updated_at = <Date 2015-05-04.12:52:21.290>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2015-05-04.12:52:21.290>
    actor = 'serhiy.storchaka'
    assignee = 'eli.bendersky'
    closed = False
    closed_date = None
    closer = None
    components = ['Extension Modules', 'XML', 'Argument Clinic']
    creation = <Date 2014-01-07.09:29:26.417>
    creator = 'serhiy.storchaka'
    dependencies = ['20141', '20157']
    files = ['33526', '38837', '39285']
    hgrepos = []
    issue_num = 20159
    keywords = ['patch']
    message_count = 13.0
    messages = ['207518', '207597', '207624', '207630', '207631', '207632', '207633', '207638', '240106', '242545', '242546', '242552', '242554']
    nosy_count = 4.0
    nosy_names = ['scoder', 'larry', 'eli.bendersky', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue20159'
    versions = ['Python 3.5']

    @serhiy-storchaka
    Copy link
    Member Author

    Here is a patch which converts xml.etree.ElementTree accelerator module to use Argument Clinic. 34 methods are converted. Not converted __init__ methods (is Argument Clinic support it?) and the SubElement function which seems can't be converted.

    @serhiy-storchaka serhiy-storchaka added extension-modules C modules in the Modules dir topic-XML type-feature A feature request or enhancement labels Jan 7, 2014
    @larryhastings
    Copy link
    Contributor

    Can you refresh the patch? The comments Argument Clinic uses were all changed. I'll review when you have a fresh patch. And I'll look at __init__ and subelement then.

    @larryhastings larryhastings changed the title Convert the ElementTree module to use Argument Clinic Derby: Convert the ElementTree module to use Argument Clinic Jan 7, 2014
    @larryhastings
    Copy link
    Contributor

    (Converting this issue into Derby entry #7. Serhiy has stated that
    he is abandoning his ElementTree patch; it may make a good starting point for you if you take over this issue.)

    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/_elementtree.c: 31 sites
    PC/_msi.c: 15 sites
    PC/bdist_wininst/install.c: 5 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

    @larryhastings larryhastings changed the title Derby: Convert the ElementTree module to use Argument Clinic Derby #7: Convert 51 sites to Argument Clinic across 3 files Jan 7, 2014
    @serhiy-storchaka
    Copy link
    Member Author

    Here is refreshed patch.

    @serhiy-storchaka serhiy-storchaka changed the title Derby #7: Convert 51 sites to Argument Clinic across 3 files Derby: Convert the ElementTree module to use Argument Clinic Jan 8, 2014
    @serhiy-storchaka
    Copy link
    Member Author

    Oh, what's the strange idea to group unrelated modules together?

    @larryhastings
    Copy link
    Contributor

    As I discussed with you on IRC, the problem is, we have 129 files with sites that need examining. I was advised that creating 129 issues on the tracker was a bad idea. So I had to combine them together somehow. I wrote a Python script to group them into bundles of approximately 50 sites, and it work largely at random.

    I did ask you several times for feedback on the bundles, as you had expressed some interest in how the bundles were aggregated, but you did not respond.

    @larryhastings
    Copy link
    Contributor

    Since you have abandoned your patch, please stop changing the issue title on me.

    @larryhastings larryhastings changed the title Derby: Convert the ElementTree module to use Argument Clinic Derby #7: Convert 51 sites to Argument Clinic across 3 files -> Derby: Convert the ElementTree module to use Argument Clinic Jan 8, 2014
    @serhiy-storchaka
    Copy link
    Member Author

    This is ridiculous.

    @serhiy-storchaka
    Copy link
    Member Author

    Updated patch. Converted __init__ methods and removed explicit declarations of self parameters. SubElement and Element.__init__ still are not converted, as they need the support of **kwargs.

    @serhiy-storchaka
    Copy link
    Member Author

    Made compatible with Windows compiler (I hope).

    @larryhastings
    Copy link
    Contributor

    LGTM

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 4, 2015

    New changeset fea94f9cb5a0 by Serhiy Storchaka in branch 'default':
    Issue bpo-20159. Converted the _elementtree module to Argument Clinic.
    https://hg.python.org/cpython/rev/fea94f9cb5a0

    @serhiy-storchaka
    Copy link
    Member Author

    Original issue is resolved and I have no any relations to modules added by Larry.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @arhadthedev
    Copy link
    Member

    Closing after gh-64383 (see discussion in that issue and #triage Discord channel).

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir topic-argument-clinic topic-XML type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants