Martin Panter added the comment: Did you see my class attributes suggestion a couple messages back? That might solve your dispatch problem:
def _parse_isodatetime(cls, string): match = cls._iso_regex.match(...) class time: _iso_regex = re.compile(...) # or time._iso_regex = re.compile(...) date._iso_regex = ... For the C module, start looking at /Modules/datetimemodule.c. Maybe if you can think of a similar function implemented in C to copy off. It looks like strptime() defers to a Python-only implementation; maybe that is another option. ---------- stage: -> patch review _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15873> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com