[merge] 'raise NotImplemented'

Martin Pool mbp at canonical.com
Wed Sep 27 01:30:27 BST 2006


On 26 Sep 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:
> In inventory.py there are a lot of places that are doing:
> 
> if not foo:
>   return NotImplemented
> 
> I'm pretty sure all of these should be:
> 
> if not foo:
>   raise NotImplemented
> 
> Attached is a patch which fixes them.

-1, Lukas is right.

Python, rather confusingly, has separate NotImplemented and
NotImplementedError.  NotImplemented is a constant which can be returned
by __eq__ etc.

Actually it might be worth grepping that we never try to raise
NotImplemented.
-- 
Martin




More information about the bazaar mailing list