3 ms·
PEP 403: Proposal to Add Block-like Feature to Python
- thristian 15y agoThis is a thing that Python badly needs; especially for callback-heavy frameworks like Twisted. Unfortunately, the proposed syntax seems deeply un-Pythonic to me (to be fair, it's based on decorators whose syntax is also deeply un-Pythonic). The most natural syntax I've ever seen proposed for this features is a trailing "where:" like this: x = ((p + q) / r, (p - q) / r) where: p = -b q = sqrt(b*b - 4*a*c) r = 2*a Unfortunately, that choice was nixed because of a fear that people would expect "where" to behave like SQL's "where". The second best English word would be "having", which fails the same test, and I can't really think of any more. :(
- Klonoar 15y ago"scope(d)"? Would make perfect sense to me.