On Tue, Feb 23, 2021 at 01:57:08PM -0300, Soni L. wrote:

> 64-bit bools were a mistake, tbh. Oh well, at least we tried.

What language are you talking about?

In Python, bool is a subclass of int, which is a BigNum, not 64 bits.

>>> False.bit_length()
0
>>> (~False).bit_length()
1


> What about getting the parser to recognize ^~ as an XNOR operator and 
> have __xnor__ on bools actually do xnor on bools? Make xnor a real 
> operator by fusing two operators together!

Let's not break existing code for the sake of an operator that hardly 
anyone ever uses.

There are exactly 2**4 = 16 boolean operators of two variables. Python 
only supports two: `and` and `or`. Plus a single unary operator `not` 
(out of four possible unary operators). What makes xnor so special that 
you want it to be an operator?

Do you have any use-cases for an xnor operator? What do you use it for?

These are not rhetorical questions. If you want to push this proposal 
forward, you need to start with actual concrete use-cases, not "it would 
be nice ..." and "how about ...".

Why can't you write a function to do what you want?


-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/AO6DLI7SHFLWJXJZY7ZGA3DVWPIZI6FT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to