In article <5178b1db$0$29977$c3e8da3$54964...@news.astraweb.com>,
 Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote:

> The semantics of NotImplemented is that it is a signal for one object to 
> say "I don't know how to do this, let somebody else try".

That's precisely the logic here.  The rule says, "I don't know how to 
tell you if this is OK or not, ask another rule".

> Since rules apparently take no arguments, either:
> 
> 1) they rely on global state, which is a nasty design; or
> 
> 2) rules actually have a fixed return result, in which case why make them 
> functions in the first place?

Yes, rules take arguments.  I elided them from the original description 
since it wasn't germane to what I was trying to show.

> Since both possibilities seem stupid, and I do not believe that Roy 
> actually is stupid,

I am honored that you have such a high opinion of me :-)

Here's what the docs say about NotImplemented:

> This type has a single value. There is a single object with this 
> value. This object is accessed through the built-in name 
> NotImplemented. Numeric methods and rich comparison methods may 
> return this value if they do not implement the operation for the 
> operands provided. (The interpreter will then try the reflected 
> operation, or some other fallback, depending on the operator.) Its 
> truth value is true.

It gives an example of a use by numeric methods.  It doesn't say that's 
the only thing it can be used for.

It also says, "Its truth value is true".  Why would they document that 
fact if you weren't supposed to use it as a boolean operand?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to