This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients amaury.forgeotdarc, belopolsky, brett.cannon, brian.curtin, daniel.urban, lemburg, mark.dickinson, pitrou, r.david.murray, rhettinger, techtonik, vstinner
Date 2010-06-18.19:34:05
SpamBayes Score 5.41198e-07
Marked as misclassified No
Message-id <1276889647.34.0.271438558157.issue7989@psf.upfronthosting.co.za>
In-reply-to
Content
> My understanding is that the desire to have pure 
> python versions of standard library modules is 
> to decouple the standard library from dependency 
> on CPython as far as practical.

That is a bit of a broad brush.  I do not know
of an approved project to give all C modules
a pure python equivalent (in fact modules like
pickle presented a long-term maintenance problem
in that the two versions differed and modules
like sets.py were dropped entirelly).

Looking at svn.python.org/view/python/trunk/Modules/
I see some which are good candidates and many which
aren't.  We need to show judgment on which one to do
and recognize that maintaining dual code is a 
heavy maintenance burden and only do so where
there is a clear value add.

In my judgment, something like str.split() would
benefit quite a bit from a pure python equivalent
because its spec is somewhat opaque and hidden
in C code and because both docs and the test 
coverage are incomplete.

In contrast, I believe that dual code for datetime 
is a net loss.  There is a reason that Uncle Timmy 
didn't put it in in the first place.  

Also, for those who haven't tried it before, it is
not always easy to get good pure python equivalents
(i.e. C iterators check their arguments when first
called and Python versions do their argument checking
when next() is first called; C functions sometimes
do interesting keyword argument handling that cannot be 
done in pure python; and pure python versions differ
in their tracebacks).  Also, it's easy to make a mistake
and misspecify the pure python version.  You're relying
on the test suite to catch all semantic differences.
History
Date User Action Args
2010-06-18 19:34:07rhettingersetrecipients: + rhettinger, lemburg, brett.cannon, amaury.forgeotdarc, mark.dickinson, belopolsky, pitrou, vstinner, techtonik, r.david.murray, brian.curtin, daniel.urban
2010-06-18 19:34:07rhettingersetmessageid: <1276889647.34.0.271438558157.issue7989@psf.upfronthosting.co.za>
2010-06-18 19:34:06rhettingerlinkissue7989 messages
2010-06-18 19:34:05rhettingercreate