As a side note, It would be great to have a 'preview' for HN comments. I updated the above because I forgot to add line breaks. Sigh. I bet 'preview' would stop a lot of not well thought out comments too.
you can set “delay” in your profile to delay the live posting of a comment after you click the button.
gives me ten minutes to edit (rewrite if i’m honest) before other people see it.
Would this statement decorator then manipulate the AST of the following statement or how would that work?
For what it's worth, you can already do: x = retry(3)(failure_prone_call)(y)
And, for that matter, expensive_module = lazy(importlib.import_module)('expensive_module') .
good luck with that syntax - it would be as possible as passing an inline-defined def as parameter instead of a lambda
import expensive_module
could be:
@lazy
import expensive_module
or you could do:
@retry(3)
x = failure_prone_call(y)
lazy is needed, but maybe there is a more basic change that could give more power with more organic syntax, and not create a new keyword that is special purpose (and extending an already special purpose keyword)