News for hackers. Stuff that matters.
Re:In Memoriam: Tim Peters 1952–2026 by bigstrat2003 on Wednesday November 11, 2026 @03:02PM (#50457890)
Python has never followed the Zen. The irritating way the language lets you use non-booleans in a boolean context flies right in the face of "explicit is better than implicit".
Re:In Memoriam: Tim Peters 1952–2026 by michaeldh on Wednesday November 11, 2026 @03:31PM (#50458258)
Practicality beats purity!
Re:In Memoriam: Tim Peters 1952–2026 by logophobia on Wednesday November 11, 2026 @04:19PM (#50458838)
Except it mostly just leads to suprising bugs and time wasting, in exchange for saving a small amount of typing
Re:In Memoriam: Tim Peters 1952–2026 by loeg on Wednesday November 11, 2026 @03:38PM (#50458344)
And typing wasn't explicit for a long time. Now it is kind of best practice, but you can still produce Python without typecheck metadata.
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/

Re:In Memoriam: Tim Peters 1952–2026 by benji-york on Wednesday November 11, 2026 @07:56PM (#50461478)
Do you know why it is the way it is?
Re:In Memoriam: Tim Peters 1952–2026 by isityettime on Thursday November 12, 2026 @11:51AM (#50470322)
That's because the Zen is a collection of fuzzy aphorisms about taste. Python has in fact never had a set of hard principles that constrain the design of the language.

In other traditions, type systems or the borrow checker or even vaguer things like a commitment to a "tiny core" of just a few primitives constrain language designers in a way that (sometimes inflexibly) commits them to the consequences of earlier design decisions. Python has mostly been designed one step at a time, by fiat. It's not a surprise that the result is an inconsistent language, especially after the resignation of the BDFL, and especially after so many years of widespread popularity.