News for hackers. Stuff that matters.
Re:In Memoriam: Tim Peters 1952–2026 by zestyping on Wednesday November 11, 2026 @07:16PM (#50461026)
[delayed]
Re:In Memoriam: Tim Peters 1952–2026 by tacitusarc on Wednesday November 11, 2026 @07:58PM (#50461489)
Booleans are reductionist and likely harmful, as they allow programmers to avoid thinking in terms of the test they are actually performing: is this a member of some set? If the problem is reworked like that Booleans are superfluous (this representation could be compiled to something as performant as using Booleans).

I am not sure if that perspective aligns with yours.

Re:In Memoriam: Tim Peters 1952–2026 by zephen on Thursday November 12, 2026 @01:04AM (#50463604)
Not sure why you're getting downvoted so much, but to put this thought into a somewhat broader context:

In an explicitly, statically typed language, bools might be useful as a standard small enum.

In what Python used to be, they weren't, not really.

But for whatever reason, declared typing is now an add-on to the language, and the people who like the verbosity of declared typing also, perhaps schizophrenically, like the terseness afforded by having a standard small enum.

Re:In Memoriam: Tim Peters 1952–2026 by driggs on Thursday November 12, 2026 @02:35AM (#50464144)
I still have a printed stack of Python 1.5.7 docs from when I first learned the language.

The addition of boolean `True` and `False` were a huge improvement to the language when they were finally added in 2.3.

I'm not sure why you're making things more complicated than they need to be. Test for truthiness. Conditional statements already evaluate boolean expressions, you're not adding anything explicit by writing `== True`.

Re:In Memoriam: Tim Peters 1952–2026 by zephen on Thursday November 12, 2026 @01:22PM (#50471767)
> I still have a printed stack of Python 1.5.7 docs from when I first learned the language.

Argument by verified hoarder?

> The addition of boolean `True` and `False` were a huge improvement to the language when they were finally added in 2.3.

Hard disagree.

Re:In Memoriam: Tim Peters 1952–2026 by jodrellblank on Thursday November 12, 2026 @12:56PM (#50471342)
> "Every primitive type has a null value"

Does it? "bank account has 0 dollars" and "no bank account" are different states. 0 cannot (should not) try to represent both. Same for empty string, empty list, empty set, they are data not nulls. Python has None for that.

Re:In Memoriam: Tim Peters 1952–2026 by pdonis on Thursday November 12, 2026 @02:26PM (#50472813)
But None has its own type; it's not a value of any of the other primitive types. Which makes sense if you use None to represent "no data present" vs. "data present, value is the null value".
Re:In Memoriam: Tim Peters 1952–2026 by pdonis on Thursday November 12, 2026 @02:29PM (#50472871)
> it became possible to compare things as equal to True or False

Not if you just use the objects as their natural types. For example:

    >>> "" == False
    False
    >>> "a" == True
    False
> "if x" and "if x == True" are now very similar, but subtly different, ways to express the same thing.

No, they're not. See above.

Protip: Before making any claims about the behavior of a language with a REPL, test them at the REPL.

Re:In Memoriam: Tim Peters 1952–2026 by pdonis on Thursday November 12, 2026 @10:17PM (#50477736)
> If we had stuck with 0 and 1, we would have avoided all this confusion.

I don't see how. Indeed, using 0 and 1, the int values, as if they were boolean false and true created more confusion. First, int has more values than just 0 and 1--and all of them are "truthy". Second, treating 0 and 1 as booleans is still treating boolean-ness as a noun--but also confusing that with treating it as an adjective for those int values.

PEP 285, which introduced the bool type, gives other rationales as well:

https://peps.python.org/pep-0285/