HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
satwikkansal
wtfpython
Python2017–2026
satwikkansal / wtfpython

wtfpython

What the f*ck Python? đŸ˜±

43Distinct people
53Mentions
1Explicit recommenders
37.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

What the f*ck Python? đŸ˜±

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

Yes, of course. BTW, that's not the "biggest" WTF feature; it's just my favorite. There's a long list of WTF features here: https://github.com/satwikkansal/wtfpython Otherwise,


cs702 used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 6:01:08 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year53 dated mentions

Observed mentions: 2017-08-31 14:14:16 UTC to 2026-08-26 02:55:54 UTC.

0510152017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 3 submissions, 0 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 7 mentions; 2 submissions, 5 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 13 mentions; 5 submissions, 8 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 8 mentions; 1 submissions, 7 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 7 mentions; 2 submissions, 5 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC330
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC211
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC725
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC1358
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC817
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC413
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC413
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC303
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC725
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

What Hacker News says

7 sources
Hi, author of the repo (https://github.com/satwikkansal/wtfpython) here, pleasantly surprised to wake up to this thread about it. The intention of the project is not to put Python in a bad light relative to other languages, the intention was to explore it more deeply through (sometimes contrived) snippets that give non-obvious outputs. I believe for a regular Python programmer, the "Slippery Slopes" section is a must-know. The first section (Strain your brain), does contain some patterns that you may not ever see in real world, the goal there is to just learn about internals. Agreed some of them are very obvious for a well-learned programmer, and some of them aren't even Python specific, it does help a lot of beginner to intermediate programmers. I remember it being given as a supplementary material in one of the CS-based course. It is cu
Read the rest
rated with something-for-everyone approach, I expect people to learn a thing or two about Python / CS after going through the snippets. I haven't updated it in a while in a major way, but looking at the feedback I'll try to organise them better, and add new snippets (I have a long personal list that I maintain) in a future release!
In What the Fuck Python
See also: https://github.com/satwikkansal/wtfpython The "interactive notebook" link goes to the colab page. There are many earlier threads associated with the markdown version, for example: https://news.ycombinator.com/item?id=21862073 (2019-12-23, 185 comments) https://news.ycombinator.com/item?id=26097732 (2021-02-11, 163 comments) https://news.ycombinator.com/item?id=31566031 (2022-05-31, 143 comments) https://news.ycombinator.com/item?id=37281692 (2023-08-27, 82 comments)
In What the Fuck Python
behnamoh·Apr 21, 2025Submission

Ask HN: Is there any programming language that doesn't have WTFs?

After reading this page: https://github.com/satwikkansal/wtfpython?tab=readme-ov-file#-needles-in-a-haystack- I wonder if there's any language that thought about all edge cases and avoided exceptions and such gotchas at the design level. JS is notorious for such WTFs but even Python—which I've used for over a decade now—has surprised me countless times. Is Haskell also like that? How about Lisps (CL, Racket, Clojure, Scheme, etc.)?
5 points · Open discussion

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.