deletestatement in a local scope PTC-W0043
Passing a local variable to a
del statement results in that variable being removed from the local namespace.
When exiting a function all local variables are deleted, so it is unnecessary to explicitly delete variables in such cases.
It is recommended to remove this
def my_func(): task = do_some_task() evaluate_task(task) del task # This is unnecessary.
def my_func(): task = do_some_task() evaluate_task(task)