Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add datetime.fromisoformat to the benchmarks #66

Closed
Morwenn opened this issue Jul 9, 2018 · 2 comments · Fixed by #135
Closed

Add datetime.fromisoformat to the benchmarks #66

Morwenn opened this issue Jul 9, 2018 · 2 comments · Fixed by #135

Comments

@Morwenn
Copy link

Morwenn commented Jul 9, 2018

Python 3.7 added datetime.fromisoformat to the datetime library, which might be another target to add to the benchmarks without timezones for completeness.

Now a few remarks about the function:

  • It is only meant to parse the result of isoformat, so it isn't super flexible compared to what you provide
  • I looked at the implementation and while it should be faster than using the equivalent strptime, it is still implemented in pure Python, so it's highly unlikely to beat your implementation.
@movermeyer
Copy link
Collaborator

Thanks! Yes, I've been looking into datetime.fromisoformat intensely.

In cPython, it is actually implemented both in Python and in C and the C version is faster than any other method (including ciso8601).
I've been working on a backport of it to older Python versions.

There is an open issue to rewrite the docs to be more comprehensive and inclusive of alternatives.

@Morwenn
Copy link
Author

Morwenn commented Jul 13, 2018

I wasn't aware that there was also a C implementation, it's nice to know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants