R. David Murray <rdmur...@bitdance.com> added the comment:

I think we have no standard for this yet, though it has been discussed.  If you 
can't find a python-dev thread about it, you should probably start a new one.

As one example, heapq does:

  try:
      from _heapq import *
  except ImportError:
       pass

after having defined the python.  Which does not incur parsing overhead in most 
real-world situations since most distributions generate the .pyc files during 
install, but does incur the execution overhead on first import.

On the other hand, io doesn't fall back to _pyio at all (perhaps this is a bug).

As for the tests, the way this is typically done is that you define a base test 
class that is *not* a TestCase, and then you define two subclasses that are 
TestCases and mix in the base class.  You then assign the appropriate module 
(or function or whatever) under test as attributes of the subclasses, and the 
base class uses those attributes to run the tests.  That way you know all the 
tests are run for both the Python and the C implementation.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7989>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to