Yesterday was quite unusual for me, I spent a whole day on one thing, writing python. It was also mostly quite pleasant.
The stupidest thing was discovering that `os.path.exists` can accept integers, and treats them as file descriptors, meaning `os.path.exists(0)` is true, and anything that coerces to 0 is also true for example the Boolean value false
@brunogirin yes. When I hit this I took it for granted that accepting file descriptors actually made sense for someone, then it was pointed out to me, the file descriptor is not a path. Why did they even add this? I wondered if it was inherited Legacy, but they explicitly added this in 3.3.
- replies
- 1
- announces
- 0
- likes
- 0