Hacker GitHub

← All repos

satwikkansal/wtfpython

View on GitHub ↗ ★ 37,133 Python

What the f*ck Python? 😱

53 mentions on Hacker News by 43 people: 16 stories, 37 comments · first 2017-08-31 · latest 2026-08-26

Mentions per year 53 mentions · busiest year 2020 (13)
20082026
  1. You've probably just gotten used to it so you don't notice it anymore: https://github.com/satwikkansal/wtfpython (Note some of these are outdated, but some of those only mention that towards the end of the section rather than the beginning)
  2. …doesn’t have its own set of absolutely monstrous footguns? https://github.com/denysdovhan/wtfjs - https://github.com/satwikkansal/wtfpython - https://news.ycombinator.com/item?id=31216080 - https://www.dolthub.com/blog/2023-08-16-go-pitfall…
  3. 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…
    comment by satwik · 2025-07-20 · in What the Fuck Python
  4. 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…
    comment by omoikane · 2025-07-19 · in What the Fuck Python
  5. someone should make one for Python based on https://github.com/satwikkansal/wtfpython
  6. …I'm just saying I haven't seen anything close to these things: https://github.com/denysdovhan/wtfjs https://github.com/satwikkansal/wtfpython
    comment by IshKebab · 2025-06-27 · in Weird Expressions in Rust
  7. …it a small handful of times. But it also seems like quite a source of footguns. Many examples here: https://github.com/satwikkansal/wtfpython rely on the misuse of the walrus operator.
    comment by rich_sasha · 2025-04-04 · in My Rust experience after eight years
  8. …you were right :) I would recommend to take a look at one of my favourite repos for more[1]. [1] https://github.com/satwikkansal/wtfpython
    comment by alkh · 2024-11-04 · in Interview gone wrong
  9. To be fair, there are edge cases [0] when it does look weird. [0] https://github.com/satwikkansal/wtfpython?tab=readme-ov-file...
    comment by throwaway313373 · 2024-11-04 · in Interview gone wrong
  10. See this for an explanation - https://github.com/satwikkansal/wtfpython?tab=readme-ov-file... > all([]) returns True since the iterable is empty.
  11. …# AssertionError because it was interpreted as # `(1 < 2) and (2 == should_be_ascending)` [1]: https://github.com/satwikkansal/wtfpython
    comment by BoppreH · 2023-06-11 · in This is valid Python syntax
  12. See https://github.com/satwikkansal/wtfpython "Mutating the immutable" is my personal favourite - the second line of code fails with an exception despite having already succeeded: >>> t = ([1, 2], 5, 6) >>> t[0] += [3, 4] TypeError:…
    comment by pansa2 · 2023-03-30 · in Wat [video] (2012)
  13. You'll have better results with https://github.com/satwikkansal/wtfpython
    comment by asicsp · 2023-03-30 · in Wat [video] (2012)
  14. …snippets helpful for learning a new language : https://github.com/jackzhenguo/python-small-examples https://github.com/satwikkansal/wtfpython/blob/master/README... https://www.30secondsofcode.org/python/p/1 Finally, "The Hitchhiker’s Guide…
  15. See also related: "What the fuck Python?" https://github.com/satwikkansal/wtfpython Along with the corresponding HN discussion: https://news.ycombinator.com/item?id=31566031 (450 points, 153 comments)
  16. …default arguments is the one I see most likely to come up regularly, it's gotten us a few times: https://github.com/satwikkansal/wtfpython#-beware-of-default...
  17. …vein you may like "WTF Python: Exploring and understanding Python through surprising snippets": https://github.com/satwikkansal/wtfpython HN thread: https://news.ycombinator.com/item?id=26097732 (163 comments) PS: found with a site I'm…
  18. …they'd just dismissed as buggy behavior and avoided touching. The ones I remember them mentioning: https://github.com/satwikkansal/wtfpython#-mutating-the-immu... https://github.com/satwikkansal/wtfpython#-beware-of-default... And I…
    comment by Izkata · 2021-02-25 · in Python for Lisp Programmers (2000)
  19. …course, there always is more than one way to do it in Python. Python's "easy to use" is just a lie, https://github.com/satwikkansal/wtfpython The common lisp CFFI module is nothing short of Python's. But, I know, people hate to put their…
    comment by jxy · 2021-02-24 · in Python for Lisp Programmers (2000)
  20. …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, I agree, it's a pretty good going :-)
  21. …me to sell it on its elegance. There's just no _need_. It's already the #1 example of wtfpython https://github.com/satwikkansal/wtfpython#-first-things-firs... /rant. Those kind of features are going to keep coming anyway, I'm afraid.
  22. …talking about functions defined in for loops all sharing a reference to the same variable [2]. [1] https://github.com/satwikkansal/wtfpython#-beware-of-default... [2] https://github.com/satwikkansal/wtfpython#-loop-variables-le... > In…
  23. …that it was cause by a bug in my code, thanks for pointing this out - now I know what caused this https://github.com/satwikkansal/wtfpython#-beware-of-default...
  24. …* https://python-patterns.guide/ by Brandon Rhodes --> inspired from Gang of Four book * https://github.com/satwikkansal/wtfpython (this is more of a collection) --> Exploring and understanding Python through surprising snippets Also, my…
    comment by asicsp · 2020-12-15 · in Legally Free Python Books List
  25. …quickly whether the claimed skills are actually there or not. For example, the easier sections in > https://github.com/satwikkansal/wtfpython might give you a hint for topics that most seasoned Python programmers should know blindfolded…
  26. There's a repo dedicated for such snippets: https://github.com/satwikkansal/wtfpython
    comment by asicsp · 2020-10-10 · in So you think you know Python
  27. …had when they were learning python. And which entry it is is usually different between them. [0] https://github.com/satwikkansal/wtfpython
  28. This repo may be helpful to you: https://github.com/satwikkansal/wtfpython It’s a collection of snippets to explain behaviors that may be considered unexpected.
  29. …[0] the first time in my code and couldn't find the reason why my unit tests where failing. [0] https://github.com/satwikkansal/wtfpython#-a-tic-tac-toe-whe...
  30. If anyone's looking for some more good WTFs in Python: https://github.com/satwikkansal/wtfpython
  31. > Python is a good language because it's readable and writeable. https://github.com/satwikkansal/wtfpython
    comment by wolfgke · 2020-04-28 · in SICP in Python
  32. …the "default parameter" version relies on a feature that also gives rise to another WTPython entry: https://github.com/satwikkansal/wtfpython/blob/master/README...
  33. …following is valid typed code and my personal favorite WTF: def func() -> int: return True Because: https://github.com/satwikkansal/wtfpython/blob/master/README... I understand the decision that was made in the python 2 era. Nowadays…
  34. Pls read again https://github.com/satwikkansal/wtfpython#-mutating-the-immu...
  35. the first really wtf thing on there is https://github.com/satwikkansal/wtfpython/blob/master/README... where both effect and exception happen; up to that point it's business as usual with garden variety corner cases or implementation…
  36. …enjoy "WTF, JS?" https://github.com/denysdovhan/wtfjs Or it's slightly older brother "WTF, Python?" https://github.com/satwikkansal/wtfpython
  37. If you think that's funny, here's a nice overview over some python gotchas: https://github.com/satwikkansal/wtfPython
    comment by dakra · 2018-03-13 · in PyTorch – Internal Architecture Tour