A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-March/002640.html below:

[Python-Dev] Boolean type for Py3K?

[Python-Dev] Boolean type for Py3K? [Python-Dev] Boolean type for Py3K?Moshe Zadka Moshe Zadka <mzadka@geocities.com>
Fri, 17 Mar 2000 22:52:29 +0200 (IST)
On Fri, 17 Mar 2000, Barry A. Warsaw wrote:

> Almost a year ago, I mused about a boolean type in c.l.py, and came up
> with this prototype in Python.

Cool prototype!
However, I think I have a problem with the proposed semantics:

>     def __cmp__(self, other):
>         if (self.__flag and other) or (not self.__flag and not other):
>             return 0
>         else:
>             return 1

This means:

true == 1
true == 2

But 

1 != 2

I have some difficulty with == not being an equivalence relation...

> I think it makes sense to augment Python's current truth rules with a
> built-in boolean type and True and False values.

Right on! Except for the built-in...why not have it like exceptions.py,
Python code necessary for the interpreter? Languages which compile
themselves are not unheard of <wink>

> But unless it's tied
> in more deeply (e.g. comparisons return one of these instead of
> integers -- and what are the implications of that?) 

Breaking loads of horrible code. Unacceptable for the 1.x series, but 
perfectly fine in Py3K

--
Moshe Zadka <mzadka@geocities.com>. 
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4