From e681645a54422f40577ce59c0ce6799abaa565b9 Mon Sep 17 00:00:00 2001 From: qinchunhua Date: Mon, 17 Oct 2016 21:03:26 -0400 Subject: [PATCH] Avoid use xx=[] for parameter to initialize it's value This patch is deprecated use xx = [] for the parameter initial value, this parameter will only be initialized at the first call,this is not what we expected. Better choice is to set the initial value to None, then initialize xx with xx= xx or [] in method body. More details:http://effbot.org/zone/default-values.htm Change-Id: Iee0648fd500422f48c3f7f35b5066fdc644ae308 --- watcher/api/middleware/auth_token.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/watcher/api/middleware/auth_token.py b/watcher/api/middleware/auth_token.py index 942bc5a0e..585d4958e 100644 --- a/watcher/api/middleware/auth_token.py +++ b/watcher/api/middleware/auth_token.py @@ -33,7 +33,7 @@ class AuthTokenMiddleware(auth_token.AuthProtocol): for public routes in the API. """ - def __init__(self, app, conf, public_api_routes=[]): + def __init__(self, app, conf, public_api_routes=()): route_pattern_tpl = '%s(\.json|\.xml)?$' try: