Right now, syntax warning is generated with the following code.
@cached
def expensive_function():
...
However, the use of @cached in this context can be useful in some contexts. Example: @cached does effectively the same thing with significantly less code as the following construct using a global variable:
HAS_RUN=False
def expensive_function():
global HAS_RUN
if HAS_RUN:
return
else:
HAS_RUN=True
Can this syntax warning be configurable and/or removed?
Right now, syntax warning is generated with the following code.
However, the use of
@cached
in this context can be useful in some contexts. Example:@cached
does effectively the same thing with significantly less code as the following construct using a global variable:Can this syntax warning be configurable and/or removed?