3 ms·
Back in 2012, I ran into a similar problem. The Python standard library has "isoformat()", which converts Python datetime objects to "2012-09-09T18:00:00-07:00"
by Animats 12y ago
Back in 2012, I ran into a similar problem. The Python standard library has "isoformat()", which converts Python datetime objects to "2012-09-09T18:00:00-07:00" format. This is the format used in emails and RSS feeds. But there was no standard function for the inverse, parsing such strings, that got all the cases, including time zone offsets, right. Others had discovered this problem and tried to fix it. The Python repository, PyPi, had four different versions of such parsers, each broken in a different way. Because there's no way to fix anything in PyPi (it's just a list of links; it doesn't host the source), each person who had found a problem had forked the code and hosted their version somewhere else. People have been posting bug reports about this since 2008.
Further discussion unearthed seven more different Python implementations.
https://groups.google.com/forum/#!topic/comp.lang.python/Q2w4R89Nq1w https://groups.google.com/forum/#!topic/comp.lang.python/Q2w...
Two years later, there's been little convergence. There's a currently maintained version on Bitbucket at (https://bitbucket.org/micktwomey/pyiso8601 https://bitbucket.org/micktwomey/pyiso8601). It has four forks.
So there are now 15 different versions of this little function. A function for which there is a well defined spec, an RFC and an ISO standard, for what it is supposed to do.
That's the open source process.
- pgeorgi 12y agoPython has PEP to extend the base system including the standard library. Maybe it should go through that instead of being third party code in some "repository"? The closed source market of (say) third party win32 controls (GUI widgets) is also messy - just look at how many calendar widgets are out there, but nobody complains there. That's "market forces at work" ;-)
- maxerickson 12y agoStuff like adding a single function to a library doesn't warrant the PEP process. Fixing this is moving forward: http://bugs.python.org/issue15873 http://bugs.python.org/issue15873 (Perhaps it's fair to say, slowly moving forward)
- Animats 12y agoAh, yes, I put that issue into the tracker two years ago.