[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-16 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: After all our discussions I'm closing this with resolution "don't do that then". -- resolution: -> wont fix status: open -> closed ___ 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,

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

[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 from t

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: Yes, this issue bothers me. Currently _sha1.sha1 constructor will use NULL (not None) value if used without parameters: _sha1.sha1() _sha1.sha1(None) will throw error while _sha1.sha1() won't. So for NULL (not None) default value, the generated signature _sha1.

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-12 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: When one specifies a default of NULL, the generated signature doc indicates a default of None. However, if the user actually supplies None, perhaps as a placeholder in a positional-only call, C code which only checks for NULL will fail inappropriately.