Oct
27
Leaks into the Enclosing Scope
In three separate discussions on the Python mailing lists this month, people have objected to some design because it leaks something into the enclosing scope. But "leaks into the enclosing scope" isn't a real problem. It's something that implies the actual problem they're complaining about—but it implies many different things.
Often, people are just worrying because what they're doing would be a problem in C or Lisp or whatever their first language is. Many of these problems aren't true in Python, or are in theory but are never or rarely relevant to most Python scripts or modules, in which case the solution is to just stop worrying.
Sometimes, there is a real problem. But it's worth knowing what the real problem is, so you can solve that.
Often, people are just worrying because what they're doing would be a problem in C or Lisp or whatever their first language is. Many of these problems aren't true in Python, or are in theory but are never or rarely relevant to most Python scripts or modules, in which case the solution is to just stop worrying.
Sometimes, there is a real problem. But it's worth knowing what the real problem is, so you can solve that.