[issue20228] Argument Clinic should understand Python special methods

2014-01-12 Thread Larry Hastings
Changes by Larry Hastings : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue20214] Argument Clinic rollup fixes

2014-01-13 Thread Larry Hastings
Changes by Larry Hastings : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-13 Thread Larry Hastings
Larry Hastings added the comment: Okay, life has gotten even more complicated. In another issue (#20172) Zachary Ware pointed out that Argument Clinic needs to generate "self" parameters in the text string. But this complicates life for inspect.Signature, which needs to not publish

[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2014-01-13 Thread Larry Hastings
Larry Hastings added the comment: > Clinic should be adding 'self' to the signature, > which should then be picked up by the __text_signature__ > parser, and used by inspect and pydoc. This innocent little comment has derailed my whole day. You're right, 'self

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-13 Thread Larry Hastings
Larry Hastings added the comment: Not for builtins. -- ___ Python tracker <http://bugs.python.org/issue20189> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-13 Thread Larry Hastings
Larry Hastings added the comment: Here's an updated patch. I tried to "do it right" which wound up being a huge amount of work in Clinic. The actual change to inspect.Signature was really easy, once I understood everything. The churn in the .c files is because Clinic no

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-13 Thread Larry Hastings
Larry Hastings added the comment: > Another issue is that with the patch applied help() is broken for > certain forms of docstrings: Yeah. We discussed this briefly in #19674. I wanted to use a marker that wasn't The Convention That People Have Used For Decades but I felt overrule

[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2014-01-13 Thread Larry Hastings
Larry Hastings added the comment: Filed comments on everything. -- ___ Python tracker <http://bugs.python.org/issue20172> ___ ___ Python-bugs-list mailin

[issue20252] Argument Clinic howto: small typo in y# translation

2014-01-13 Thread Larry Hastings
Larry Hastings added the comment: Same bug for 'y' too. Will fix in a patch probably Tuesday. Thanks for pointing it out! -- ___ Python tracker <http://bugs.python.o

[issue20260] Argument Clinic: add unsigned integers converters

2014-01-14 Thread Larry Hastings
Larry Hastings added the comment: Very nice! I had an idea to do this in the back of my head too. But my plate is already full. I haven't reviewed the patch yet--and I have a huge backlog of reviews already. But I can give this higher priority if you need it for other patches. Wh

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-14 Thread Larry Hastings
Larry Hastings added the comment: Dang it, I forgot to add the second patch. Here it is. -- Added file: http://bugs.python.org/file33467/larry.support.text_signature.on.more.types.diff.2.txt ___ Python tracker <http://bugs.python.org/issue20

[issue16612] Integrate "Argument Clinic" into CPython trunk

2014-01-14 Thread Larry Hastings
Larry Hastings added the comment: Meador Inge: In the future, please create new issues for these sorts of fixes. -- ___ Python tracker <http://bugs.python.org/issue16

[issue16612] Integrate "Argument Clinic" into CPython trunk

2014-01-14 Thread Larry Hastings
Larry Hastings added the comment: If it's not worth a new issue, then you can check it in without citing an issue at all. -- ___ Python tracker <http://bugs.python.org/is

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-14 Thread Larry Hastings
Larry Hastings added the comment: Updated the patch. (Diff #2 apparently didn't apply cleanly, so we didn't get a review link.) Old-guard core devs: I'm *really* desperate for a review of this patch. You don't have to review everything thing, just these files:

[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-01-14 Thread Larry Hastings
Larry Hastings added the comment: Antoine Pitrou took care of cryptmodule.c. -- title: Derby #17: Convert 50 sites to Argument Clinic across 14 files -> Derby #17: Convert 49 sites to Argument Clinic across 13 files ___ Python tracker &l

[issue20226] Argument Clinic: support for simple expressions?

2014-01-14 Thread Larry Hastings
Larry Hastings added the comment: The attached patch extends Argument Clinic and the inspect module: now you may use simple (!) expressions as default values. So for example "sys.maxsize - 1" should now work fine. * Names may be in the current module; as a backup they will also be

[issue20268] Argument Clinic: support cloning existing functions

2014-01-14 Thread Larry Hastings
New submission from Larry Hastings: It was a quick hack: Clinic now has a syntax for cloning an existing function! The first line of the function block should be module.class.new_function [as c_basename] = module.class.existing_fn Hurry up and give me a LGTM so you can use it everywhere

[issue20268] Argument Clinic: support cloning existing functions

2014-01-14 Thread Larry Hastings
Larry Hastings added the comment: Shall I just check it in and fix it if it breaks? -- ___ Python tracker <http://bugs.python.org/issue20268> ___ ___ Python-bug

[issue20268] Argument Clinic: support cloning existing functions

2014-01-14 Thread Larry Hastings
Larry Hastings added the comment: Begun, the clone war has. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2014-01-14 Thread Larry Hastings
Larry Hastings added the comment: Zachary: If you refresh your copy of trunk, you can now "clone" functions. See the howto for the syntax. The failure you were seeing was in some code that I just rewrote (see #20226). I'd be interested if you could apply that patch and try

[issue20187] The Great Argument Clinic Conversion Derby Meta-Issue

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: Can you give me an example of performance degradation due to Argument Clinic? What percentage slowdown is common? -- ___ Python tracker <http://bugs.python.org/issue20

[issue20187] The Great Argument Clinic Conversion Derby Meta-Issue

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: Until you have some numbers, your assertion has no weight and should be ignored. (As Carl Sagan once wrote: "That which can be asserted without evidence can be dismissed without evidence." And as Donald Knuth wrote: "Premature optimization is

[issue20260] Argument Clinic: add unsigned integers converters

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: We can use this now. So I bumped it to the top of my queue and reviewed it. I had only minor feedback--thanks! -- ___ Python tracker <http://bugs.python.org/issue20

[issue20226] Argument Clinic: support for simple expressions?

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: That's okay, email me a sample at larry at hastings dot org and I'll take a look at it. Be sure to tell me which patch(es) were applied at the time. (Note: all you need to send is the Cl

[issue20226] Argument Clinic: support for simple expressions?

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: I'd prefer it if you emailed me as I asked. That will help me get to it a lot quicker. -- ___ Python tracker <http://bugs.python.org/is

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: One mandate I've given myself for this project: When a function provides a signature, it must be 100% accurate. A specific corollary of this: If you call a function, and for every optional parameter you explicitly pass it in with its default value

[issue20231] Argument Clinic accepts no-default args after default args

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: I'll fix this, but it's lower priority than the new features for Clinic that people need in order to get unblocked. -- ___ Python tracker <http://bugs.python.o

[issue20178] Derby #9: Convert 52 sites to Argument Clinic across 11 files

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: In the past few days I added "cloning" functions, which lets you reuse the parameters and return converter from an existing function. That might help with Modules/_ctypes/_ctypes. -- ___ Python trac

[issue20178] Derby #9: Convert 52 sites to Argument Clinic across 11 files

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: All the functions in curses_panel are convertable. The threeMETH_NOARGS functions simply get no arguments. And here's new_panel: new_panel window: object(subclass_of='&PyCursesWindow_Type') / -- ___

[issue20274] sqlite module has bad argument parsing code, including undefined behavior in C

2014-01-15 Thread Larry Hastings
New submission from Larry Hastings: The code in Modules/_sqlite/connection.c is sloppy. The functions pysqlite_connection_execute, pysqlite_connection_executemany, and pysqlite_connection_executescript accept a third "PyObject *kwargs". However none of these functions are marked ME

[issue8876] distutils should not assume that hardlinks will work

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: Has this been fixed? -- ___ Python tracker <http://bugs.python.org/issue8876> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20273] Argument Clinic: unhelpful crashes

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: I'm marking this as a duplicate of #20226, the "add general-purpose expressions" issue, because that will fix the behavior you're seeing. As for "in general Argument Clinic should have better error reporting", this is too gener

[issue20235] Argument Clinic: recover a bit more gracefully from exceptions

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: LGTM, please commit. -- ___ Python tracker <http://bugs.python.org/issue20235> ___ ___ Python-bugs-list mailing list Unsub

[issue20274] sqlite module has bad argument parsing code, including undefined behavior in C

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: You're right, deprecation sounds best. If Georg or Benjamin want the fix in earlier releases I'll split the pysqlite_connection_call into another issue, otherwise I won't bother. As for fixing the undefined behavior in older versions: since

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: Nick, could you maybe review this? -- nosy: +ncoghlan ___ Python tracker <http://bugs.python.org/issue20189> ___ ___ Python-bug

[issue20260] Argument Clinic: add unsigned integers converters

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: I'm glad you caught that! First things first: the converted code should behave identically to the existing code, including raising the same exceptions. If you examine the exception hierarchy: http://docs.python.org/3.4/library/exceptions.html#exce

[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 consid

[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: > is the best approach for this to define winreg_OpenKeyEx_impl > as `return winreg_OpenKey_impl(module, key, sub_key, reserved, > access);`? Sounds good to me. -- ___ Python tracker <http://bug

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: Why wouldn't my suggestion work? _sha1.sha1(b'').hexdigest() == _sha1.sha1().hexdigest(). -- ___ Python tracker <http://bugs.pyt

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: Also: how would PEP 457 help? PEP 457 only addresses extensions to support positional-only parameters, and the parameter in question (the "string" parameter to _sha1.sha1) is positional-or-keyword. --

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: Definitely not []. At the very least (). I'd appreciate it if you'd stop abruptly changing the subject. I thought we were talking about SHA1_new, but now you're talking about "address" and "sockobj.sendmsg". If you have s

[issue20234] Argument Clinic: use PyTuple_GET_SIZE?

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: I suppose so. It would be hard to measure the resulting speedup. But I guess we get it for free. I made the change in my "simple expressions" branch. So it'll go in when that does. -- resolution: -> fixed stage: -> comm

[issue20256] Argument Clinic: compare signed and unsigned ints

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: Good point. My brain is dead. What would be a better "magic cookie" value? -- ___ Python tracker <http://bugs.python.o

[issue20133] Derby: Convert the audioop module to use Argument Clinic

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: I don't understand. Python already has "double" which is float64. Why would Python need a second floating-point type which isn't as good? In any case, if somehow you get float32 in, we could just change the return converters then. So

[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: Someone else came up with this hack using a custom converter: class PID_converter(int_converter): format_unit = '" _Py_PARSE_PID "' Also, for marshal.version, soon you will be able to. This syntax won't work now but it will soon

[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-01-15 Thread Larry Hastings
Larry Hastings added the comment: Keep track of #20226, that's the issue where I'm adding improved support for simple expressions like "version". -- ___ Python tracker <http://bug

[issue20262] Convert some debugging prints in zipfile to warnings

2014-01-16 Thread Larry Hastings
Larry Hastings added the comment: I will bow to the wisdom of my predecessor and accept this patch for beta 3. -- ___ Python tracker <http://bugs.python.org/issue20

[issue20226] Argument Clinic: support for simple expressions?

2014-01-16 Thread Larry Hastings
Larry Hastings added the comment: Okay, I have a fix for the help(os.chmod) problem, that'll be in the next refreshed patch. -- ___ Python tracker <http://bugs.python.org/is

[issue20226] Argument Clinic: support for simple expressions?

2014-01-16 Thread Larry Hastings
Larry Hastings added the comment: Isn't that what it does? I may actually remove py_default. Nobody uses it, and I don't think you need it--you just specify what you want as the real default value. -- ___ Python tracker <http://bu

[issue20226] Argument Clinic: support for simple expressions?

2014-01-16 Thread Larry Hastings
Larry Hastings added the comment: Second rollup patch. More small fixes, many suggested by other folks. -- Added file: http://bugs.python.org/file33492/larry.clinic.rollup.patch.two.diff.2.txt ___ Python tracker <http://bugs.python.org/issue20

[issue20226] Argument Clinic: support for simple expressions?

2014-01-16 Thread Larry Hastings
Larry Hastings added the comment: Py_buffer is currently inflexible. The only default value it accepts is None. If you want it to be required, give it no default value. If you want it to be optional, give it a default value of None. Do you have a use case for any other default value

[issue20226] Argument Clinic: support for simple expressions?

2014-01-16 Thread Larry Hastings
Larry Hastings added the comment: Third patch, changes based on Georg's review. Thanks, Georg! -- Added file: http://bugs.python.org/file33499/larry.clinic.rollup.patch.two.diff.3.txt ___ Python tracker <http://bugs.python.org/is

[issue20226] Argument Clinic: support for simple expressions?

2014-01-16 Thread Larry Hastings
Larry Hastings added the comment: Sorry, forgot to update trunk, here you go. -- Added file: http://bugs.python.org/file33500/larry.clinic.rollup.patch.two.diff.4.txt ___ Python tracker <http://bugs.python.org/issue20

[issue20226] Argument Clinic: support for simple expressions?

2014-01-16 Thread Larry Hastings
Larry Hastings added the comment: Done! Georg: Thanks for the suggestion, and for the reviews! Argument Clinic is improved this day. -- ___ Python tracker <http://bugs.python.org/issue20

[issue20226] Argument Clinic: support for simple expressions?

2014-01-16 Thread Larry Hastings
Changes by Larry Hastings : -- resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracker <http://bugs.python.or

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-16 Thread Larry Hastings
Larry Hastings added the comment: Whoever does the review, could you post here? I feel bad enough asking y'all, maybe we don't need multiple people doing it ;-) -- ___ Python tracker <http://bugs.python.o

[issue20287] Argument Clinic: support diverting output to buffer, external file, etc

2014-01-16 Thread Larry Hastings
New submission from Larry Hastings: The long-awaited, highly desirable "buffer" patch is here! With features I figured would never see the light of day. Changes in this patch: * New directive "output": output redirects a "field" (subsection of Cl

[issue20287] Argument Clinic: support diverting output to buffer, external file, etc

2014-01-17 Thread Larry Hastings
Larry Hastings added the comment: If I removed support for all destinations except files, I might be able to remove fifty lines or so. However, I'm not planning on doing that. Does cryptmodule.c, which has exactly one function, really need a 20-line separate file? Also, the "file

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-17 Thread Larry Hastings
Larry Hastings added the comment: Updating / merging / resolving now, but it will take me a few minutes. -- ___ Python tracker <http://bugs.python.org/issue20

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-17 Thread Larry Hastings
Larry Hastings added the comment: Here's a fresh patch against trunk. It applies cleanly against current tip (725bc24f5492). -- Added file: http://bugs.python.org/file33517/larry.support.text_signature.on.more.types.diff.4.txt ___ Python tr

[issue20287] Argument Clinic: support diverting output to buffer, external file, etc

2014-01-17 Thread Larry Hastings
Larry Hastings added the comment: I have backed out the "args" -> "_args" change. Not because I'm giving up on it, or that I necessarily think it's a bad idea, but because there are some changes happening in #20189 that will make it easier / that would co

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-17 Thread Larry Hastings
Larry Hastings added the comment: I do. Thanks for your time! -- ___ Python tracker <http://bugs.python.org/issue20189> ___ ___ Python-bugs-list mailin

[issue20287] Argument Clinic: support diverting output to buffer, external file, etc

2014-01-17 Thread Larry Hastings
Larry Hastings added the comment: I have a fix already in place for the clinic_test.py problem. I disagree with your proposed "foo.c.clinic" nomenclature, and there are advantages to "foo.clinic.c": double-clicking on them will launch the correct editor, and editors will

[issue20287] Argument Clinic: support diverting output to buffer, external file, etc

2014-01-17 Thread Larry Hastings
Larry Hastings added the comment: Done! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue20291] Argument Clinic should understand *args and **kwargs parameters

2014-01-17 Thread Larry Hastings
New submission from Larry Hastings: Argument Clinic currently prevents the "impl" function from ever seeing the "args" tuple or the "kwargs" dict. There should be a way to ask it to pass those values in to the "impl" function. -- assi

[issue20178] Derby #9: Convert 52 sites to Argument Clinic across 11 files

2014-01-17 Thread Larry Hastings
Larry Hastings added the comment: Meador: I'm going to change Argument Clinic so you can get the "args" and "kwargs" values passed in to the impl. That's issue #20291; I already added you to it "nosy" list. With that change in you

[issue20292] clinic.py str_converter with encoding throws exception

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Thanks for the report! It's fixed now. Sorry about that! -- assignee: -> larry components: +Demos and Tools -Build resolution: -> fixed stage: -> committed/rejected status: open -> closed _

[issue20177] Derby #8: Convert 28 sites to Argument Clinic across 2 files

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: That macro, STRFTIME_FORMAT_CODES, is only used in two functions. If it were me I'd just copy and paste the text into both functions. -- ___ Python tracker <http://bugs.python.org/is

[issue20282] Argument Clinic: int with boolean default

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: I think these shouldn't be "int", they should be "bool". "bool" will allow you to use a default of False. It maps to the "p" format unit, which was new in 3.3. Back before 3.3, when someone wanted a boolean the

[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

[issue20293] pydoc fails with the "unspecified" default value

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Just checking--that happens with current trunk? Revision 32f9e0ae23f7 or newer? -- ___ Python tracker <http://bugs.python.org/issue20

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Oh! I thought it worked fine, because I've seen people convert both an __init__ and a __new__. But I guess they wrapped them. It's an easy change, I can try to do that today. -- assignee: -> larry _

[issue20293] pydoc fails with the "unspecified" default value

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: I just built from a new clone of trunk, and it works fine for me. I didn't see the exception you report--I get the documentation for zlib. Do you still get the error if you build from a new clone of the current

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: > * As is probably expected, __init__ and __call__ procs > can't be converted. I should have a fix in for __init__ and __call__ later today. (Issue #20294.) For the record, you could convert them, you just had to wrap the parsing function to de

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Oops, sorry, that last comment was intended for a different issue. Please ignore, and sorry for the spam! -- ___ Python tracker <http://bugs.python.org/issue20

[issue20178] Derby #9: Convert 52 sites to Argument Clinic across 11 files

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Larry Hastings added the comment: > * As is probably expected, __init__ and __call__ procs > can't be converted. I should have a fix in for __init__ and __call__ later today. (Issue #20294.) For the record, you could convert them, you just had

[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

[issue20177] Derby #8: Convert 28 sites to Argument Clinic across 2 files

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Yes, you should drop things that look like return annotations in the original docstring. I don't have a magic formula for finding unchanged functions, sorry. -- ___ Python tracker <http://bugs.py

[issue17481] inspect.getfullargspec should use __signature__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: If we modify inspect.getfullargspec, shouldn't we modify inspect.getargspec too? "deprecated" doesn't mean "unsupported", it means "not recommended for new code, please stop using it". -- _

[issue20177] Derby #8: Convert 28 sites to Argument Clinic across 2 files

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Optional groups really are only for cases when that's the behavior of the original code. If the original function used a switch statement examining the size of the tuple, then had different parsing functions based on that size, use optional groups. But i

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Here's a patch. Wasn't as easy as I thought, it kind of took all day. Changes include: * __init__ and __new__ always take kwargs. * if the function signature doesn't accept keyword arguments, it calls _PyArg_NoKeywords(). * __init__ r

[issue20299] Argument Clinic CConverter.__init__() overrides c_default and py_default

2014-01-18 Thread Larry Hastings
Changes by Larry Hastings : -- assignee: -> larry resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python

[issue20299] Argument Clinic CConverter.__init__() overrides c_default and py_default

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Checked in. Thanks for the report, and the patch! I worked so quickly, I just realized, I didn't credit you in the NEWS file for the fix. Do you want me to fix that? -- ___ Python tracker <http://bugs.py

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Whoops, that doesn't apply cleanly. Here's an updated patch. -- Added file: http://bugs.python.org/file33542/larry.argument.clinic.init.and.new.patch.2.txt ___ Python tracker <http://bugs.python.o

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Your fixes for #1 and #2 were fine, I've incorporated them into the patch. I'll update the diff after I've added the tests Nick suggested. The assertion failure in #3 will also be gone, replaced with a failure: You can't have two par

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Checked in. Thanks for bringing the problem to my attention, Serhiy, and thanks for the reviews you two! rmsr: If I had a stronger background in templating, maybe Argument Clinic would be cleaner inside. As it is I'm beating the problem to death with

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-19 Thread Larry Hastings
Larry Hastings added the comment: Here is the hopefully-final patch for this issue. I incorporated the suggested changes from Zachary Ware. Also I fixed some "cls" parameters that were leaking into the signatures. I think this is ready for checkin! -- Added f

[issue20293] pydoc fails with the "unspecified" default value

2014-01-19 Thread Larry Hastings
Larry Hastings added the comment: Closing. Reopen it if you get a reproducible test case with a fresh checkout of trunk. -- resolution: -> works for me stage: -> committed/rejected status: open -> closed ___ Python track

[issue20300] Argument Clinic raises exception for custom converter with default

2014-01-19 Thread Larry Hastings
Larry Hastings added the comment: Thanks for the report. It was an easy fix. That said, I can't say I'm excited by the idea of a custom converter with a built-in default value. I hope you know what you're doing! -- assignee: -> larry components: +Demos and Tools

[issue17481] inspect.getfullargspec should use __signature__

2014-01-19 Thread Larry Hastings
Larry Hastings added the comment: I just want to mention, while we're all thinking about this stuff: I plan to enhance the Signature object to reflect "optional groups". Right now Signature objects cannot express parameters that are optional but don't have a publishe

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Larry Hastings
New submission from Larry Hastings: Boy was I surprised by this: >>> class C: pass ... >>> import inspect >>> inspect.signature(C) Traceback (most recent call last): File "", line 1, in File "/home/larry/src/python/clinic_c_types_hacking/Lib/inspe

[issue17481] inspect.getfullargspec should use __signature__

2014-01-19 Thread Larry Hastings
Larry Hastings added the comment: Yury: fire away, either here or in a new issue as is best. (Sorry, brain mildly fried, not sure what would be best issue-tracker hygiene.) -- ___ Python tracker <http://bugs.python.org/issue17

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Larry Hastings
Larry Hastings added the comment: __new__ and __init__ methods are very special. They can't have signatures, because the mechanism we use to store the signatures won't work. (We hide them as a special first line of the docstring, and __new__ and __init__ can't have custom d

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Larry Hastings
Larry Hastings added the comment: If we need a special case for user classes without __new__ or __init__, then do that. But I wouldn't say we should special case object.__new__ and object.__init__. -- ___ Python tracker <http://bugs.py

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Larry Hastings
Larry Hastings added the comment: inspect.signature(object) works fine in my (not yet posted) latest #20189 patch. inspect.signature(type) doesn't work, because it's not clear what the signature for type should be. There's the one-argument and three-argument approaches. This

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Larry Hastings
Larry Hastings added the comment: Special cases aren't special enough to break the rules. If the signature of a metaclass is "(object_or_name, [bases, dict])", then we must not special-case it to pretend that "(object)" works. I agree it's a bad idea to actu

[issue20309] Class method descriptors are different between builtin and user classes

2014-01-19 Thread Larry Hastings
New submission from Larry Hastings: I found something curious while experimenting with types tonight. Everybody knows, if you access a descriptor in a class through the normal attribute-getting methods, you actually get the result of calling its '__get__' method. If you want t

[issue20309] Class method descriptors are different between builtin and user classes

2014-01-19 Thread Larry Hastings
Larry Hastings added the comment: I should add, I see the same results with current trunk and with my handy Python 3 (currently 3.3.1rc1, huh guess I'm behind). -- ___ Python tracker <http://bugs.python.org/is

[issue20309] Not all descriptors are callable

2014-01-19 Thread Larry Hastings
Changes by Larry Hastings : -- title: Class method descriptors are different between builtin and user classes -> Not all descriptors are callable ___ Python tracker <http://bugs.python.org/issu

[issue20316] Byte-compiled files should be absent in tarballs

2014-01-20 Thread Larry Hastings
Larry Hastings added the comment: Your fix won't work, because release managers call hgtouch from a different spot, from a private tool called "release.py". You'll notice that all the 3.4 releases have that hgtouch.pyc file--up until 3.4b2. I already found that bug

<    9   10   11   12   13   14   15   16   17   18   >