You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adjustment: SIM401 should not apply to non-constant default values.
Explanation
When the default value in SIM401 statement isn't constant, it may be arbitrarily expensive to calculate if moved into a get. This is not something that can be simplified because python will eagerly evaluate the value in order to execute the get
Version:
flake8-simplify==0.19.3
Desired change
Explanation
When the default value in
SIM401
statement isn't constant, it may be arbitrarily expensive to calculate if moved into aget
. This is not something that can be simplified because python will eagerly evaluate the value in order to execute theget
Example
Believes it can be simplified to:
However these two are not interchangeable as
some_async_func()
may be arbitrarily expensive as demonstrated here by theasyncio.sleep(10)
The text was updated successfully, but these errors were encountered: