[issue20227] Argument Clinic: rename arguments in generated C?

2014-02-27 Thread Zachary Ware
Zachary Ware added the comment: This was added by #20456 (a couple weeks ago). -- components: +Demos and Tools resolution: - fixed stage: - committed/rejected status: open - closed superseder: - Argument Clinic rollup patch, 2014/01/31 type: - enhancement versions: +Python 3.4

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-21 Thread Zachary Ware
Changes by Zachary Ware zachary.w...@gmail.com: -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227 ___ ___ Python-bugs-list

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-21 Thread Tal Einat
Tal Einat added the comment: +1 for this. It would save a bit of manual conversion work, and would significantly reduce the size and complexity of the resulting patches. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: I have a couple big patches incoming, over the next couple of days. Here's a sneak-peek of my todo list: * buffer support just went in (#20287) * all builtins support landing maybe tomorrow (#20260) * suppress the self parameter on impl for METH_STATIC *

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-18 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: I believe the feature you starred resolves this enhancement issue, in which case my patches are obsolete. And yes, the 'as' syntax makes a lot more sense. Here's how I hope it works (the arg parsing wrapper remains unchanged): foo: int ... _impl(...,

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: On 01/18/2014 01:12 PM, Ryan Smith-Roberts wrote: Ryan Smith-Roberts added the comment: I believe the feature you starred resolves this enhancement issue, in which case my patches are obsolete. And yes, the 'as' syntax makes a lot more sense. Here's how I

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-18 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Yes, that makes more sense. The specific syntax is nearly irrelevant compared to the feature existing at all. You still haven't indicated whether your starred feature matches the *result* that I outlined. Does it? --

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: -serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227 ___ ___

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-16 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: The use case is primarily to minimize code churn for the derby, but since you're the one (heroically) doing the code review it's really your call. I whipped up a quick patch for this feature, and even if you remove c_name from __init__ I think it's still

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-16 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: Added file: http://bugs.python.org/file33494/argument_clinic_ensure_legal_cleanup.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227 ___

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-16 Thread Zachary Ware
Zachary Ware added the comment: The nested scope trick makes me happy. There are still a lot of cases in the conversions I've worked on where a variable had to be renamed due to having documented a different name for the parameter, but in the vast majority of those cases the new name makes

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: I don't see the big win from this. You can rename variables in C any way you like. functionname as c_basename is to fix otherwise unavoidable collisions; this seems like a nice-to-have. And I already have a lot on my plate. I could consider it later but

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-15 Thread Georg Brandl
Georg Brandl added the comment: I guess custom converters are the answer here. BTW, the args argument already works fine since adding it to c_keywords. No need for a complicated structure :) -- ___ Python tracker rep...@bugs.python.org

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-13 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: -- nosy: +rmsr ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227 ___ ___ Python-bugs-list mailing

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-13 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Georg Brandl wrote: Although now is a good time to ensure sensible argument names (I usually look at the docs to find the documented ones), so that switching the function to keyword arg support is basically just a removal of '/' I started doing this

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-12 Thread Georg Brandl
New submission from Georg Brandl: This is a request to be able to name C arguments differently from Python arguments. Two reasons: * like for function renaming, some Python argument names are reserved in C (default for example, used in sys.getsizeof()) * sometimes the function uses 'O' in

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-12 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227 ___ ___ Python-bugs-list

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: OK, I see that AC automatically handles case 1, great! Still you have to decide if you like the code churn caused by case 2. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: One more: I can't have an argument called args. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227 ___ ___

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-12 Thread Zachary Ware
Zachary Ware added the comment: I second this request. Every PyArg_ParseTupleAndKeywords-using function in _winapi has a keyword argument overlapped which is stuffed into a C variable use_overlapped, while the local variable overlapped is used for an Overlapped object, which makes for a big

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-12 Thread Georg Brandl
Georg Brandl added the comment: There are also several PyArg_ParseTuple-using functions that have the same kind of name mismatch, but since the names don't really mean anything on the Python side when they're positional-only, I don't feel too bad about changing them to make them make