logoalt Hacker News

js2 • yesterday at 9:33 PM • 2 replies • view on HN

More succinctly, you can run this as a module:

  $ python -m this  # -mthis works too

Replies

driggs • today at 7:24 AM

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."

➕ show 2 replies
nine_k • today at 4:11 AM

The call to import this has more than the Python syntax meaning.