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/020844.html below:

[Python-Dev] Boolean transition

[Python-Dev] Boolean transitionMartin v. Loewis martin@v.loewis.de
09 Mar 2002 23:34:59 +0100
Paul Prescod <paul@prescod.net> writes:

> I'm in favour of adding the boolean feature in as compatible a manner as
> possible. But I think that we need a transition plan to separate
> booleans from integers. Booleans are not integers and
> True+True-False+5=6 is just weird. Arithmetic manipulation of booleans
> should be deprecated and should fade away. isinstance(True, int) should
> be deprecated. etc.

I don't find that too wierd; certainly not more puzzling than {} < ().
If arithmetic operations on booleans are to be deprecated, I'd suggest
the following strategy:
- add booleans to 2.3 (or perhaps 2.4?)
- deprecate arithmetic operations on them in 2.4, by means of a warning

This will tell how frequent that warning is, so it may need to be
disabled in 2.4.1. If it is going to stay
- let arithmethic operations on booleans raise TypeErrors in 2.5
- stop inheriting from int in 2.6.

> The current subtyping strategy provides a better hook for deprecation
> warnings. My only concern is that we decide and document that booleans
> will one day be as completely unrelated to integers as exceptions are to
> strings.

I'm not sure that this is desirable. By the same rationale, you should
argue that boolean operations on integers are a bad thing. This would
be not Pythonic.

Regards,
Martin



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