wtfpython: a single README of surprising Python snippets, its five sections, and the 2019 release it still points to
What the f*ck Python? 😱
At a glance
- What is it?
- satwikkansal/wtfpython is a long Markdown collection of counter-intuitive Python snippets with explanations of what happens under the hood. It reads well as a quiz or a teaching aid, but it is not a library, its last tagged release is v3.0.0 from December 2019, and its translations live in separate repositories.
- Who is it for?
- Read wtfpython if you already write Python and want to test what you think you know about identity, scoping, iteration and string handling, or if you need quiz material for a study group. Do not treat it as a reference for the current interpreter: the last release is v3.0.0 from 2019-12-21 and the last push was 2026-01-13, so before quoting an example as current behavior, run it on the Python version you actually use.
- Can I use it commercially?
- Yes. WTFPL is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Activity is slowing. The repository last received commits 10 months ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- satwikkansal/wtfpython37,144 ★ · +85
| Repository | 2026-08-18 | 2026-11-15 |
|---|---|---|
| satwikkansal/wtfpython | 37.1k | 37.1k |
85 Stars in the last 89 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The whole project is one long README built as a puzzle sequence
wtfpython is not a package you import. Its product is README.md, subtitled Exploring and understanding Python through surprising snippets, and everything else in the repository supports that file. Each entry shows a short snippet whose output does not look obvious at first sight, then explains what is happening under the hood. The author is explicit that some entries are not WTFs in the truest sense; they are there because they expose parts of the language many programmers have never looked at. The README pitches two ways to read it. Newcomers can treat it as a tour of internals. Experienced Python programmers are invited to treat it as a challenge and try to get most entries right on the first attempt before reading the explanation. That framing matters for how you use it: the value comes from predicting the output yourself first, so skimming the explanations in order wastes most of what the collection offers. The table of contents is generated with markdown-toc at depth 3, which is why every entry is reachable by anchor link from the top of the page.
Five sections, from Strain your brain to Miscellaneous
The examples are grouped into five sections, and the grouping tells you what kind of surprise to expect. Strain your brain is the largest and covers identity and equality puzzles such as How not to use is operator, Hash brownies, Deep down, we're all the same, Subclass relationships, Methods equality and identity, Nan-reflexivity, and Exceeds the limit for integer string conversion. Slippery Slopes is closer to production bugs: Modifying a dictionary while iterating over it, Deleting a list item while iterating, Loop variables leaking out, Beware of default mutable arguments, Catching the Exceptions, Name resolution ignoring class scope, Rounding like a banker and Midnight time doesn't exist?. The Hidden treasures section collects easter eggs, with titles such as Okay Python, Can you make me fly?, goto, but why?, Brace yourself!, Ellipsis, Inpinity and Let's mangle. Appearances are deceptive covers code that does not do what it looks like it does, in Skipping lines?, Teleportation and Well, something is fishy. Miscellaneous closes with entries such as += is faster. If you are hunting for bugs that bite real code, Slippery Slopes is the section to read first.
Asterisks mark the newest entries, but the release log stops in 2019
Entries with an asterisk after their title, such as First things first!, Disorder within order, Keep trying..., The chicken-egg problem, All-true-ation, Lossy zip of iterators, Splitsies, Wild imports and All sorted?, are the ones added in the latest major revision. Returning readers are pointed to the GitHub releases page to see what changed. That page has two entries: v2.0.0 on 2018-01-22 and v3.0.0, titled What the f*ck Python! (3.0), on 2019-12-21. The repository kept receiving pushes after that, with the most recent on 2026-01-13, but none of that later work is summarized in a newer release. The consequence for a returning reader is that the asterisks and the releases page only tell you about the 3.0 revision. Anything that changed in the six years after it has to be found by reading the commit history on master, the default branch. The pyproject.toml file still declares version 3.0.0, matching the last tag.
There is no install step, because there is nothing to install
The repository ships a pyproject.toml, but it does not turn wtfpython into a tool you add to a project. It declares a Poetry project named wtfpython, version 3.0.0, built with poetry-core, requiring Python ^3.9 and depending only on nox ^2024.10.9. A noxfile.py and a .pre-commit-config.yaml sit at the root alongside .travis.yml and .markdownlint.yaml, which together point to repository maintenance tooling rather than a runtime library. The README gives no pip command and no import path. The way to use the project is to read it, in one of three forms: the README on GitHub, the Interactive Website at wtfpython-interactive.vercel.app, or the Interactive Notebook that opens irrelevant/wtf.ipynb in Google Colab. The notebook is the practical choice if you want to run each snippet as you go, since it lets you execute the code next to the explanation instead of copying it into a local interpreter. Snippets also live in the snippets/ directory.
Results depend on the interpreter you run them on
The collection explains what happens under the hood, and under the hood is where interpreters change between releases. Entries such as Exceeds the limit for integer string conversion and += is faster are about how the interpreter behaves, not only about what the language grammar allows. The version constraint in pyproject.toml, python = "^3.9", governs the project's own tooling, not which interpreter each example was checked against. The content was revised for 3.0 in 2019 and touched again as late as 2026-01-13, so entries were written at different times. The consequence is that if you lift an example into a blog post, an interview question or a code review comment, the output shown in wtfpython is a claim about one interpreter at one point in time. Run the snippet on the version your team ships before stating it as fact, and be ready for some outputs to differ from the README.
Translations are forks maintained in other repositories
The README links seven translations, and only two of them live inside this repository: Russian and Persian, under the translations/ directory. Chinese is maintained at leisurelicht/wtfpython-cn, Vietnamese at vuduclyunitn/wtfptyhon-vi, Korean at buttercrab/wtfpython-ko and German at BenSt099/wtfpython. The Spanish link goes to a Wayback Machine snapshot from 2022-05-11 of JoseDeFreitas/wtfpython-es rather than to a live repository. Nothing in the English README ties these forks to the current English content, so a translated copy can lag behind or diverge, and the Spanish one is frozen at the date of that snapshot. Anyone who wants to start a new translation is sent to open an issue titled Add translation for the language, stating an expected time to finish. If you read a translation, compare its table of contents with the English one before assuming you are seeing every entry.
WTFPL licensing and a profane title shape where you can use it
The repository is licensed under the WTFPL, recorded as WTFPL 2.0 in pyproject.toml. The project name itself is What the f*ck Python!, the title on the README, the release names and the package description. That combination is friendly to individual learners, who can copy and adapt snippets freely, but the name can be awkward to link in some corporate training material or classroom settings. The contribution side is set up for a community project: the root holds CONTRIBUTING.md, CONTRIBUTORS.md and code-of-conduct.md, and the author is listed as Satwik Kansal in pyproject.toml.
Editorial conclusion
Read wtfpython if you already write Python and want to test what you think you know about identity, scoping, iteration and string handling, or if you need quiz material for a study group. Do not treat it as a reference for the current interpreter: the last release is v3.0.0 from 2019-12-21 and the last push was 2026-01-13, so before quoting an example as current behavior, run it on the Python version you actually use.
Frequently asked questions
What are some funny Python codes collected in wtfpython?
wtfpython includes entries such as A tic-tac-toe where X wins in the first attempt!, Schrödinger's variable, Okay Python, Can you make me fly? and goto, but why?. Each one shows a snippet and then explains what happens under the hood.
How does wtfpython describe what Python is?
The wtfpython README calls Python a high-level, interpreter-based programming language that provides many features for the programmer's comfort. The project uses surprising snippets from that language to teach its internals.
Can I run the wtfpython snippets without copying them by hand?
Yes. wtfpython offers an Interactive Notebook that opens irrelevant/wtf.ipynb in Google Colab, and an Interactive Website at wtfpython-interactive.vercel.app.
When was the last wtfpython release?
The last tagged wtfpython release is v3.0.0, published on 2019-12-21. The repository was last pushed on 2026-01-13.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/satwikkansal-wtfpython)Star history chart for your README
[](https://hysenlabs.com/projects/satwikkansal-wtfpython)Was this useful?