Re: [Python-ideas] Cofunctions: It's alive! Its alive!
On Aug 10, 2010 6:18 PM, "Greg Ewing" <greg.ewing@canterbury.ac.nz> wrote:
Bruce Leban wrote:
Is there a pythonesque alternative?
It's generally considered unpythonic to assign arbitary meanings to randomly chosen punctuation (decorator syntax notwithstanding!) ...
I quite agree. I hate random punctuation. Suppose hypothetically that cocall is just one of a class of execution modifiers that we might ultimately want to add. In that case maybe there's a syntax (analogous to adding decorator syntax) that doesn't require new keywords. There's yield, yield from and cocall. Are there more? (I don't know. I'm just wondering.) --- Bruce (via android)
Bruce Leban wrote:
In that case maybe there's a syntax (analogous to adding decorator syntax) that doesn't require new keywords. There's yield, yield from and cocall.
'yield from' was a happy accident -- there just happened to be two existing keywords that could be put together in a suggestive way. We don't get that lucky very often. The problem with general-purpose syntax extension hooks is that they don't usually allow you a syntax that's really well tailored for what you want to do. Typically you end up with something of a kludgy compromise.
Are there more?
Beats me. My crystal ball has been having reception problems for years. Really should get a new one. -- Greg
participants (2)
-
Bruce Leban
-
Greg Ewing