Suggestion for improved ImportError message

Fredrik Lundh fredrik at pythonware.com
Sat Aug 23 19:08:13 CEST 2008


Lie wrote:

>> I have code that uses numpy if available, otherwise uses slower normal
>> Python code. Inside the doctests I'd like to test both situations...
> 
> Why? Is there a difference in result if you have used numpy and python
> code? If that is, I smell a bad code. What numpy and python code
> version would return in that situation should be the same (practically
> it isn't always feasible though).

maybe the point is to use doctest to *verify* that the code generates 
the same result whether or not numpy is used?

</F>




More information about the Python-list mailing list