codon
codon copied to clipboard
"unexpected dedent" at declaration of async method
Hi all, at my first try of codon, compilation failed with 'unexpected dedent' error. Here's a simplified paraphrase of the code:
class Foo(Bar):
if SERVICE_MODE == SERVICE_MODE_WHATEVER:
needCorpDb = False
def __init__(self):
controls = Controls(CONTROLS_SET)
super().__init__(controls)
... other stuff ...
async def initialise(self): # <<<< THIS IS WHAT CODON CALLS 'unexpected dedent'
await super().initialise()
... other stuff ...
The same code runs perfectly ok with CPython.
Am I missing something?
Cheers David
Hi @davidmcnabnz -- Codon doesn't yet support async, but we intend to add it in a future release (see https://github.com/exaloop/codon/issues/71).
Thanks @arshajii . Understood. In this case, I think it's fair to say there's a UI bug in Codon, where it fails to mention its current lack of support for async. It might make sense to update Codon to output a more explicit and understandable error message.