3 ms·
Hey Pythonistas x('.b', onclick=func ev: print("clicked") end) You're welcome.
by mantap 6y ago
Hey Pythonistas
x('.b', onclick=func ev:
print("clicked")
end)
You're welcome.
- pansa2 6y ago`end`? In my Python?!
- mantap 6y agoIt's more likely than you think. You need some end delimiter, it doesn't matter what it is as long as there is one. Just like list literals end with ] and dict literals end with } and str literals end with " or ' etc.
- zild3d 6y ago> it doesn't matter what it is as long as there is one of course it matters, there are design decisions in languages. a certain pattern or syntax may feel just right in one language but very much wrong in another. Throwing in an `end)` like that feels wrong in python https://www.python.org/dev/peps/pep-0020/ https://www.python.org/dev/peps/pep-0020/
- mantap 6y agoIt doesn't matter functionally. You can make the end token "waffleiron" or "mariahcarey" or "%^*~$". But there does need to be an end token to make multiline lambdas work and recognizing that is the first step to solving the problem. Once you have the scaffolding of the syntax you can turn it over to the bikeshedders on the mailing list to make it pretty.