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

Argument Clinic: wrap impl's declaration if it's too long #68132

Closed
zware opened this issue Apr 14, 2015 · 12 comments
Closed

Argument Clinic: wrap impl's declaration if it's too long #68132

zware opened this issue Apr 14, 2015 · 12 comments
Assignees
Labels
topic-argument-clinic type-feature A feature request or enhancement

Comments

@zware
Copy link
Member

zware commented Apr 14, 2015

BPO 23944
Nosy @larryhastings, @zware
Files
  • _winapi.c
  • larry.clinic.wrap.long.impl.decls.1.txt
  • larry.clinic.wrap.long.impl.decls.2.txt
  • 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/larryhastings'
    closed_at = <Date 2015-04-14.22:09:20.101>
    created_at = <Date 2015-04-14.02:28:04.364>
    labels = ['type-feature', 'expert-argument-clinic']
    title = "Argument Clinic: wrap impl's declaration if it's too long"
    updated_at = <Date 2015-04-14.22:09:20.101>
    user = 'https://github.com/zware'

    bugs.python.org fields:

    activity = <Date 2015-04-14.22:09:20.101>
    actor = 'larry'
    assignee = 'larry'
    closed = True
    closed_date = <Date 2015-04-14.22:09:20.101>
    closer = 'larry'
    components = ['Argument Clinic']
    creation = <Date 2015-04-14.02:28:04.364>
    creator = 'zach.ware'
    dependencies = []
    files = ['39002', '39008', '39012']
    hgrepos = []
    issue_num = 23944
    keywords = []
    message_count = 12.0
    messages = ['240831', '240834', '240835', '240966', '240977', '240978', '240979', '240981', '240995', '241000', '241015', '241040']
    nosy_count = 3.0
    nosy_names = ['larry', 'python-dev', 'zach.ware']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue23944'
    versions = ['Python 3.5']

    @zware
    Copy link
    Member Author

    zware commented Apr 14, 2015

    For example:

    _winapi_CreateFile_impl(PyModuleDef *module, LPCTSTR file_name, DWORD desired_access, DWORD share_mode, LPSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD flags_and_attributes, HANDLE template_file)

    @zware zware added topic-argument-clinic type-feature A feature request or enhancement labels Apr 14, 2015
    @larryhastings
    Copy link
    Contributor

    If you give me a test case I'll knock this out.

    @zware
    Copy link
    Member Author

    zware commented Apr 14, 2015

    Will do in the morning.

    @zware
    Copy link
    Member Author

    zware commented Apr 14, 2015

    Larry: Here's your sample:

    /*[clinic input]
    _winapi.CreateProcess

    application_name: Py_UNICODE(nullable=True)
    command_line: Py_UNICODE(nullable=True)
    proc_attrs: object
        Ignored internally, can be None.
    thread_attrs: object
        Ignored internally, can be None.
    inherit_handles: BOOL
    creation_flags: DWORD
    env_mapping: object
    current_directory: Py_UNICODE(nullable=True)
    startup_info: object
    /
    

    Create a new process and its primary thread.

    The return value is a tuple of the process handle, thread handle,
    process ID, and thread ID.
    [clinic start generated code]*/

    static PyObject *
    _winapi_CreateProcess_impl(PyModuleDef *module, Py_UNICODE *application_name, Py_UNICODE *command_line, PyObject *proc_attrs, PyObject *thread_attrs, BOOL inherit_handles, DWORD creation_flags, PyObject *env_mapping, Py_UNICODE *current_directory, PyObject *startup_info)
    /[clinic end generated code: output=c279c1271b4c45cf input=6667ea0bc7036472]/

    @larryhastings
    Copy link
    Contributor

    I wish the Python bug tracker had a way of attaching files to issues, so we didn't have to just copy and paste into and out of the comments. Ah well, wishful thinking!

    @zware
    Copy link
    Member Author

    zware commented Apr 14, 2015

    Alright, alright, I'll get you a file.

    On Tue, Apr 14, 2015 at 1:22 PM, Larry Hastings <report@bugs.python.org> wrote:

    Larry Hastings added the comment:

    I wish the Python bug tracker had a way of attaching files to issues, so we didn't have to just copy and paste into and out of the comments. Ah well, wishful thinking!

    ----------


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue23944\>


    @zware
    Copy link
    Member Author

    zware commented Apr 14, 2015

    You can even have the whole thing, with lots of samples :)

    @larryhastings
    Copy link
    Contributor

    That's AMAZING, you mean the web site knew how to do that THE WHOLE TIME?

    @larryhastings
    Copy link
    Contributor

    Attached is a patch. This causes a lot of churn, darn.

    Should I copy & paste the patch into this text box too? Maybe that would be more convenient!

    @larryhastings
    Copy link
    Contributor

    Okay, this patch is about half the size. I had a bug that was throwing away some important syntax. With this patch applied, Python builds and the test suite is as reasonable as usual.

    I swear, C compilers are so fussy sometimes!

    @zware
    Copy link
    Member Author

    zware commented Apr 14, 2015

    After an English lesson, looks fine to me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 14, 2015

    New changeset c99ca3d7052d by Larry Hastings in branch 'default':
    Issue bpo-23944: Argument Clinic now wraps long impl prototypes at column 78.
    https://hg.python.org/cpython/rev/c99ca3d7052d

    @larryhastings larryhastings self-assigned this Apr 14, 2015
    @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
    topic-argument-clinic type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants