On Wed, 25 Nov 2009 at 07:26PM -0800, John H Palmieri wrote:
> In ring.pyx, there is code like this:
> 
>         if proof:
>             return NotImplementedError
>         else:
>             return False
> 
> I would think that the second line should say "raise
> NotImplementedError".  (Changing it makes some doctests fail,
> though.)  Is there a good reason for doing "return
> NotImplementedError"?

AFAIK, *returning* a NotImplementedError totally defeats the purpose of
try/except clauses, since then they will never see the error! Consider

  try:
     x = something_possibly_not_implemented
  except NotImplementedError:
     x = do_it_another_way

x would always get a NotImplementedError as its value!

Dan

-- 
---  Dan Drake
-----  http://mathsci.kaist.ac.kr/~drake
-------

Attachment: signature.asc
Description: Digital signature

Reply via email to