[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

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-15 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: I've realized this is basically insoluble without PEP 457, because any other solution involves changing behavior (None being silently accepted where it would previously raise an exception). If that's OK, then per-function defensive programming is probably

[issue19585] Frame annotation

2014-01-15 Thread Nick Coghlan
Nick Coghlan added the comment: Another use case from frame annotations: allowing greenlets and threads to indicate which greenlet or thread a traceback is from whenever it is printed (this is similar to the way the runtime indicates which thread a traceback occurred in when it terminates the

[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 ___ __

[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. -- ___ Python tr

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-15 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: sha1 is Vajrasky's module. I have a much more complicated example (and Vajrasky and I just both posted on python-dev separately about this issue): sockobj.sendmsg(buffers[, ancdata[, flags[, address]]]) -> sockobj.sendmsg(buffers, ancdata=None, flags=0, add

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-15 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: No, that still leaves address broken since neither None nor an empty tuple are acceptable. -- ___ Python tracker ___ __

[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 specific cases you'd like to discuss,

[issue20174] Derby #5: Convert 50 sites to Argument Clinic across 3 files

2014-01-15 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Tweaked the argument list for functions using a NULL default. Kludgy but doesn't lie to the user. -- Added file: http://bugs.python.org/file33490/argument_clinic_socketmodule_v3.patch ___ Python tracker

[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

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

2014-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset acd31653e3b4 by Georg Brandl in branch 'default': Closes #20235: Report file and line on unexpected exceptions in Argument Clinic. http://hg.python.org/cpython/rev/acd31653e3b4 -- nosy: +python-dev resolution: -> fixed stage: commit review

[issue20276] ctypes._dlopen should not force RTLD_NOW

2014-01-15 Thread Ronald Oussoren
Ronald Oussoren added the comment: The big question is why ctypes uses RTLD_NOW in the first place. There's probably a good reason for it because it's added unconditionally to the user provided flags. BTW. I'd prefer to keep the dlopen flags on OSX the same as on other platforms (that is, eit

[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: -> committed/rejected status: open

[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 ___ _

[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 I would still prefer fl

[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: version: int(c_default="Py

[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 ___ _

[issue20173] Derby #4: Convert 53 sites to Argument Clinic across 5 files

2014-01-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: s/Guide/Guido. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue20173] Derby #4: Convert 53 sites to Argument Clinic across 5 files

2014-01-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: So, as Guide said in https://mail.python.org/pipermail/python-dev/2014-January/131675.html: "In the sha1 example, however, accepting None and converting it to NULL (without a reference leak, please :-) seems fine though." I let the patches as they are.

<    1   2