bottlepy / bottle

bottle.py is a fast and simple micro-framework for python web-applications.
http://bottlepy.org/
MIT License
8.37k stars 1.46k forks source link

mutable default value {} as argument (pylint W0102) #1233

Closed zsxoff closed 4 years ago

Jwink3101 commented 4 years ago

This is a style thing but I think the first patch should be if globals is None instead of if not globals. The advantage of this is that if the user for some reason wants to take advantage of the mutable argument and passes an empty dict.

On the second patch, I think it’s actually okay since the passed dict is only used to update an independent dict. It’ll still flag on a lint check but in practice, will have no ill-affects.