new bitwise module [was Re: Discussion: new operators ...]

Ben Wolfson rumjuggler at cryptarchy.org
Tue Aug 1 19:29:04 EDT 2000


On Tue, 1 Aug 2000 19:02:11 -0400, "Tim Peters" <tim_one at email.msn.com>
wrote:

>> The PEP would describe why named functions are better, how this
>> module is going to replace the bitwise operators, and hints on a C
>> implementation when the bitwise operators are decommisioned.
>
>I could have sworn that just two weeks ago you were passionately arguing
>that named functions are intolerable for *your* field of interest <0.7
>wink>.  So be sure to explain why they're better than infix operators for
>those who like slinging ints.  I happen to sling more ints than matrices
>myself, and find no appeal in, e.g., needing to write bitleft(x, 1) instead
>of x << 1.  And after augmented assignments are in, I would strongly prefer
>writing
>
>    a[i] <<= 1
>
>to
>
>    a[i] = bitleft(a[i], 1)

Combine bitleft() et al. with augmented assignment and the proposal to use
functions in an infix-operator-like way (I think it was something like a
bitleft: 1) and you're set:

a[i] bitleft:= 1

No one in his or her right mind could possibly see anything wrong with
that.

-- 
Barnabas T. Rumjuggler's page of dumbth: members.home.net/rumjuggler

My pants!  They have come
To rescue me!  No, it is
Only a squirrel.
 -- Not Zelgadis, not on ark




More information about the Python-list mailing list