Python style guidelines

Mel Wilson mwilson at the-wire.com
Fri Mar 12 10:57:27 EST 2004


In article <c2rafr$21ftn5$1 at ID-169208.news.uni-berlin.de>,
"Greg Ewing (using news.cis.dfn.de)" <wmwd2zz02 at sneakemail.com> wrote:
>John Roth wrote:
>> I suspect that's a rather common error. I'd much prefer
>> that both find and index return an object that acted like
>> a number but returned the logically correct response when
>> queried as a boolean: true for zero and false for -1.
>
>Good heavens, no! That would be a *massively* dangerous
>object to have floating around in one's program...

   *Most* of them wouldn't float very far..  I presume that
when you did arithmetic on one of them, the magic wouldn't
metastatize to the result.  So when one did escape from the
find/index context it would be the last thing anybody
expected.

        Regards.        Mel.


ob. c.l.p.  fear, surprise



More information about the Python-list mailing list