python: bug or feature?

Huaiyu Zhu hzhu at localhost.localdomain
Thu Aug 10 14:52:55 EDT 2000


On 10 Aug 2000 12:52:14 +0200, Bernhard Herzog <herzog at online.de> wrote:
>
>hzhu at localhost.localdomain (Huaiyu Zhu) writes:
>
>> This just shows that the current arrangements of logical operators and
>> bitwise operators is a misfeature.  Bitwise operations do not deserve
>> cryptic symbols,
>
>But matrix operations do? ;-)

I see the smilie.  But to protect the innocent from being misled: :-) I was
talking about the _arrangement_ between them.  & | ~ ^ are cryptic when you
try to visually link them to (and) (or) (not) (xor).

>> especially ones with their own precedence levels. :-)
>
>What does the precedence have to do with it? That's something Python got
>right. Unlike C, where bitwise operators have the same precedence as the
>logical operators which is lower than the precedence of the comparisons.
>All that because by the time the distinction of logical and bitwise
>boolean oerators was introduced they already had too many (ISTR 40)
>users to make incompatible changes.

I understand why they might need a different level from logical operators.
But why not just one bitwise level?  Is the individual precedence levels for
bitwise operators so obvious that users could avoid using parenthesis and
ckecking docs?  Does the language really need four separate precedence
levels just for bitwise operation?

Huaiyu




More information about the Python-list mailing list