Indeed. But there are drawbacks to this.
- This would not be backwards compatible.
- Unnecessary inconvenience passing
callables as arguments, which is a very common occurrence. A lot of code would need to adapt to facilitatelambdalazy evaluation paradigm. - Performance. E.g. lambda check is expensive:
callable(x) and x.__name__ == '<lambda>. It also needstry-exceptas not all callables have__name__. Creation of lambda is also more expensive. Whilecallablecheck on its own is too general - unsuited for the purpose. - Value binding at evaluation is not a good property for this application. E.g.
lambda: a + 2versuslazy(opr.add, a, 2). The latter is contained within itself, while the former can not be used in places whereachanges value, e.g. loop. This is quite a major inconvenience which subtracts a lot of value from this.