You're right that his example is possible in Python, but that's only because with happens to be part of the language. If it were not, you couldn't write my_with in Python code alone.
Meaning that the next time you need a feature that doesn't exist in Python, you can't add it.
You should cut these examples some slack; in reality, it's going to be hard to come up with a five line Python example that's ugly, because Python is quite a nice language, and most rough edges have been sanded down over the last 20 years.
That doesn't mean the techniques aren't useful in real world programs, like when you need to build a DSL - just that they're hard to explain in a dozen line HN comment.
Meaning that the next time you need a feature that doesn't exist in Python, you can't add it.
You should cut these examples some slack; in reality, it's going to be hard to come up with a five line Python example that's ugly, because Python is quite a nice language, and most rough edges have been sanded down over the last 20 years.
That doesn't mean the techniques aren't useful in real world programs, like when you need to build a DSL - just that they're hard to explain in a dozen line HN comment.