Nikolaus Rath added the comment: As discussed on devel, here's an updated patch for timemodule.c that uses a custom C converter to handle the parse_time_t_args() utility function. The only function I did not convert is mktime, because I did not find a way to do so without duplicating the gettmarg() utility function (which cannot be converted because it is also called by other C functions).
You probably want to take a close look at what I did to the strptime function. I didn't see a way to include the actual default value (rather than None) in the signature without reconstructing the argument tuple for calling the Python implementation. As far as I can see, this completes the conversion for timemodule.c. I'll work on _datetimemodule.c next, but I'm not sure I'll have time before next weekend. This is probably already planned, but since I haven't seen it in Misc/NEWS yet: I think it would be a good idea to entry informing the user about the conversion from strictly optional parameters to parameters with default values. Eg.: * Issues xxx, yyy, zzz: many functions in the standard library now accept `None` for optional arguments. Previously, specifying `None` mostly resulted in a `TypeError`. Starting with this version, passing `None` is equivalent to not specfying the parameter. ---------- Added file: http://bugs.python.org/file33607/timemodule_rev2.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20177> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com