Re: Why can't I xor strings?
From: Alex Martelli (aleaxit_at_yahoo.com)
Date: 10/11/04
- Next message: Mike C. Fletcher: "Re: 2D height map to 3D model?"
- Previous message: Vinay Sajip: "Re: IOError: [Errno 32] Broken pipe"
- In reply to: Grant Edwards: "Re: Why can't I xor strings?"
- Next in thread: Grant Edwards: "Re: Why can't I xor strings?"
- Reply: Grant Edwards: "Re: Why can't I xor strings?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 11 Oct 2004 16:35:17 +0200
Grant Edwards <grante@visi.com> wrote:
> On 2004-10-11, Alex Martelli <aleaxit@yahoo.com> wrote:
> > Grant Edwards <grante@visi.com> wrote:
> > ...
> >> Probably so, but that doesn't support the arguement that
> >> there's something wrong with a logical xor argument coercing
> >> it's operands to boolean values unless one also argues that
> >> the logical "and", "or" and "not" operators should also not
> >> coerce their operands to booleans.
> >
> > One of the greatest sources of usefulness for 'and' and 'or' is exactly
> > that these operators _don't_ coerce their operands
>
> Surely they must coerce the operands for the "test" part if not
> for the "return" part.
We may have different conceptions about the meaning of the word
"coerce", perhaps...? For example, Python may be doing len(x) when I
use x in a boolean context, but I sure don't see computing len(x) as
"coercing" anything. To me, Coercion, in Python, is what's documented
at <http://docs.python.org/ref/coercion-rules.html> and is quite a
different concept from Truth Value Testing, which is documented at
<http://docs.python.org/lib/truth.html>.
Alex
- Next message: Mike C. Fletcher: "Re: 2D height map to 3D model?"
- Previous message: Vinay Sajip: "Re: IOError: [Errno 32] Broken pipe"
- In reply to: Grant Edwards: "Re: Why can't I xor strings?"
- Next in thread: Grant Edwards: "Re: Why can't I xor strings?"
- Reply: Grant Edwards: "Re: Why can't I xor strings?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|