server: Rework methods to avoid mutable default arguments
Mutable objects as default arguments in function or method declarations
are only assigned once over the lifetime of the function declaration
(i.e. are not assigned per function/method *invocation*). Rework such
declarations to assign None (which is immutable), and test for None in
the function/method body to assign a per-instance object.
The side-effects of mutable default arguments are explored here:
http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments
Change-Id: Id963cdecba63f7072e621208e1a3173e1646ddf1
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
1 file changed