3 ms·
I must be a crusty Python programmer, because none of the first few examples seemed like WTFs to me at all. I think a WTF is when you think you know a language
by nickm12 6y ago
I must be a crusty Python programmer, because none of the first few examples seemed like WTFs to me at all. I think a WTF is when you think you know a language and then see something that behaves completely unlike how you expect.
- nolok 6y agoAfter seeing years / decade of such things about PHP, welcome to our world.
- ben509 6y agoI was annoyed by the number of RTFMs they call WTFs. They even claim some WTFs where Python behaves exactly as a naive user would expect, e.g. if I put 5 and 5.0 in a dict they are treated as the same key. I saw two valid ones: "Lossy zip of iterators" is because Python conflates iterables and iterators, "The disappearing variable from outer scope" where deleting the exception is contrary to how scope works everywhere else. They also miss the classic newbie head-scratcher: x = [] for i in range(10): x.append(lambda: i) x[0]()
- drusepth 6y agoI'd also classify WTFs as something that behaves completely unlike how you'd expect based on knowing many other similar/related languages, also.