[Python-Dev] Using argument clinic to replace timemodule.c:parse_time_t_args()

Ryan Smith-Roberts rmsr at lab.net
Sun Jan 19 18:59:04 CET 2014


On Sun, Jan 19, 2014 at 2:38 AM, Larry Hastings <larry at hastings.org> wrote:

>  According to the issue tracker, " rmsr" has only ever filed one issue.
> I just fixed (and closed) it.
>

The two issues were "custom converter with converter and default raises
exception" and "custom converter with py_default and c_default being
overridden by __init__".

As for the former, you said "I hope you know what you're doing!" which made
me step back and think more about the "why". I realized two things:

The default-related class attributes might be an 'attractive nuisance', in
that setting them there technically saves repetition, but could easily
confuse a later reader who expects to find the defaults declared inline as
usual.

As well, it is unclear which of 'default', 'py_default', 'c_default' one
needs to set, or which has priority. Nikolaus went ahead and set all three,
thus my bug reports. After tinkering some more with the test file for the
first bug, I noticed that a class with 'default' and 'converter' generates
a default in the signature line but not at the C level.

I'm wondering now if class-level default support shouldn't just be removed,
as the aforementioned attractive nuisance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140119/74ad0786/attachment.html>


More information about the Python-Dev mailing list