Closed 5j9 closed 2 years ago
If you're curious, testing on python 3.10, there is no performance degradation after this patch:
$ # on main branch
$ python -m timeit 'import jdatetime; jdatetime.datetime.strptime("[1363-6-6] (12-13-14)", "[%Y-%m-%d] (%H-%M-%S)")'
10000 loops, best of 5: 37 usec per loop
$ # on this branch
$ python -m timeit 'import jdatetime; jdatetime.datetime.strptime("[1363-6-6] (12-13-14)", "[%Y-%m-%d] (%H-%M-%S)")'
10000 loops, best of 5: 35.3 usec per loop
I found a bug. I'll reopen when it's ready.
Rewrite
strptime
to make the code more clear.This implementation assumes 14th century for 00 <= %y <= 68 and 13th century for 69 <= %y <= 99.
This patch also fixes a bug in
strptime
where it could not handle special characters?
in the format string.Tests where added.
closes #100