News for hackers. Stuff that matters.
Re:In Memoriam: Tim Peters 1952–2026 by driggs on Thursday November 12, 2026 @02:24AM (#50464081)
You've missed the joke, or maybe you weren't old enough to be learning Python during Java's heyday.

The joke is that people wanting to write Python like Java - with an implicit reference to an object's instance - would attempt to import Java's `this` keyword.

Instead of getting Java-like behavior, they're presented with the Zen of Python. You wouldn't be wrong to think that it was as much a commentary on other popular languages of the day as it was a guiding ethos of Python itself.

"Beautiful is better than ugly. Explicit is better than implicit."

Re:In Memoriam: Tim Peters 1952–2026 by wk_end on Thursday November 12, 2026 @03:00AM (#50464311)
c.f. what happens when you try `from __future__ import braces`
Re:In Memoriam: Tim Peters 1952–2026 by js2 on Thursday November 12, 2026 @08:17AM (#50466666)
[delayed]
Re:In Memoriam: Tim Peters 1952–2026 by bjourne on Thursday November 12, 2026 @09:23AM (#50467726)
Haha, yes! Back in the day whether self should be implicit or explicit was a major point of contention. Those who loved Java and C++ found self to be almost as repugnant as Python's indentation-based syntax. I even posted code on the now defunct ActiveState site to make self implicit again:

https://web.archive.org/web/20211128002836/https://code.acti...

For good reasons, Pythonistas were not appreciative! :)

Re:In Memoriam: Tim Peters 1952–2026 by zahlman on Friday November 13, 2026 @11:44AM (#50486101)
The revamp of the object model in 3.x IMO justified the design decision more strongly, since now methods are just functions (unless and until munged by the descriptor protocol) and the class is essentially just a namespace for them. (Namespaces are one honking great idea -- let's do more of those!) In 2.x, methods were a separate "unbound method" type even when accessed through the class, even if you explicitly inherited from `object`; with this model, one could more easily imagine special accommodations for `self`.
Re:In Memoriam: Tim Peters 1952–2026 by leoc on Friday November 13, 2026 @04:15AM (#50480536)
I always assumed it was partly a reference to the famous McBainism from Star Trek: First Contact https://www.youtube.com/watch?v=qbZ-CfhuZ5s&t=88s which came out three years earlier in 1996.
Re:In Memoriam: Tim Peters 1952–2026 by zahlman on Friday November 13, 2026 @11:40AM (#50486037)
> The joke is that people wanting to write Python like Java - with an implicit reference to an object's instance - would attempt to import Java's `this` keyword.

No, that isn't where the name comes from; the slogan "import this" was chosen for Python in a contest, and the decision was made to stuff the Zen there because it was also importable code. There's no record of who submitted this slogan or what the motivation was. And I certainly never heard of anyone trying to get a `this` keyword by importing an ordinary module; that would make no sense (the closest reasonable spelling would be something like `from __future__ import this_keyword`).

https://discuss.python.org/t/in-memoriam-tim-peters-1952-202...