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/2002-March/021982.html below:

[Python-Dev] PEP 285: Adding a bool type

[Python-Dev] PEP 285: Adding a bool type [Python-Dev] PEP 285: Adding a bool typeAndrew Koenig ark@research.att.com
30 Mar 2002 11:04:13 -0500
Guido> Another argument for deriving bool from int: implementation
Guido> inheritance.  A bool must behave just like an int, and this is
Guido> most easily accomplished this way: the bool type doesn't have
Guido> implementations for most operations: it inherits them from the
Guido> int type, which find a bool acceptable where an int is
Guido> required.

Liskov substitutibility would seem to suggest deriving int from bool,
not the other way around.  That is: If I have a program that uses bool
values, I can change it so that it uses int values without affecting
the behavior of the program.  The reverse is not true.

I wonder if this is the circle-ellipse problem over again?

-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark



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