Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #44332
| From | Roy Smith <roy@panix.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: epiphany |
| Date | 2013-04-25 08:36 -0400 |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Message-ID | <roy-649E1E.08363425042013@news.panix.com> (permalink) |
| References | <roy-23D9FA.19503324042013@news.panix.com> <5178884b$0$29977$c3e8da3$5496439d@news.astraweb.com> <mailman.1045.1366857991.3114.python-list@python.org> <5178b1db$0$29977$c3e8da3$5496439d@news.astraweb.com> |
In article <5178b1db$0$29977$c3e8da3$5496439d@news.astraweb.com>, Steven D'Aprano <steve+comp.lang.python@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?
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
epiphany Roy Smith <roy@panix.com> - 2013-04-24 19:50 -0400
Re: epiphany Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-25 01:35 +0000
Re: epiphany Roy Smith <roy@panix.com> - 2013-04-24 21:41 -0400
Re: epiphany Chris Angelico <rosuav@gmail.com> - 2013-04-25 12:20 +1000
Re: epiphany Roy Smith <roy@panix.com> - 2013-04-24 22:33 -0400
Re: epiphany Ethan Furman <ethan@stoneleaf.us> - 2013-04-24 19:28 -0700
Re: epiphany Ethan Furman <ethan@stoneleaf.us> - 2013-04-24 19:25 -0700
Re: epiphany Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-25 04:32 +0000
Re: epiphany Roy Smith <roy@panix.com> - 2013-04-25 08:36 -0400
Re: epiphany Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-25 12:52 +0000
Re: epiphany Roy Smith <roy@panix.com> - 2013-04-25 09:15 -0400
Re: epiphany 88888 Dihedral <dihedral88888@googlemail.com> - 2013-04-28 14:14 -0700
csiph-web