Hi datetime mates
I would like to resume soon the C implementation of datetime iso format parsing in CPython I started days ago (http://bugs.python.org/issue15873). Currently I have 2 solutions and would like to know which one do you prefer:
* iterating on the string the string, stopping when something is wrong (might process almost all of the string and finally give up because last part is wrong, EG incorrect microseconds or time zone. Penalize invalid strings, best case when most of the strings to process are valid) * first checking the string is correct, then iterating over it and handling each part. Early detection of incorrect strings, useless overhead for valid string. Penalize valid strings, best case when most of the strings to process are invalid).
I have a preference for solution #1. I first thought of using sscanf but it's impossible for many reasons, the first of them is scanf is unsuitable for variable numbers of match (you can't express optional match in scanf format).
Waiting for your input.