new bitwise module --- Use operator module!!

Huaiyu Zhu hzhu at localhost.localdomain
Wed Aug 2 18:46:19 EDT 2000


On Wed, 2 Aug 2000 20:23:25 +0100, Penfold <spam at spam.com> wrote:
>Why do we need *another* module representing bitwise infix operators??
>There already is one !!
>
>Its called operator.  You know, the one you keep finding so useful in map
>functions ;-) If you dont like all that "line noise" then how about.

Thanks for this reminder.  Yes, it has the builtin bitwise operations,
except I can't find correspondent to ~.  It's not 'not':
>>> operator.__not__.__doc__ 
'not_(a) -- Same as not a.'
Neither are the other possible candidates:  neg, inv.

BTW, the new bitwise module has more than the standard operators, like
bitand(a,b,c,d,e), and extraction and settting of single bits, etc.

> The following little excerpt did tickle my fancy tho,
>
>>That's the idea.  So let's have it.   That would make adding new math
>>operators a little easier to swallow as well. :-)
>
>Obviously, <<, >>, & | are classified as "linenoise" and should be removed
>from the language.  Now,
>exactly how are all these proposed matrix operators ~+ .* not line noise??
>And how does *dropping/hiding* one set of operators suddenly make it more
>acceptable to insert an equally bizarre
>looking set for matrix users :-)

You obviously missed the smilie.  (Oops, I nearly missed yours as well.)

But seriously though, if you are intrigued, please read my follow up to Tim
in the same thread.  [Disclaimer: Please don't read that as a call to remove
bitwise operators from the language any time soon.  Otherwise we'll go a
full circle of the exchange again.]

Huaiyu



More information about the Python-list mailing list