Loading
rpc: remove mutable default argument
Using mutable objects (e.g. a dict) as default arguments to a function can lead to unexpected behavior, as the same object will be used for each call to that function. For example: def foo(bar, baz=[]): baz.append(bar) return baz >>> foo(1) [1] >>> foo(2) [1, 2] We don't want params to be remembered between function calls, so they're now default initialized to None and set to an empty dict in the body of the function. Signed-off-by:Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I63c71b5424286658759f09aed2d30c529c2d1081 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19807 Reviewed-by:
Artur Paszkiewicz <artur.paszkiewicz@intel.com> Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by:
Jim Harris <jim.harris@gmail.com> Reviewed-by:
Tomasz Zawadzki <tomasz.zawadzki@intel.com>