From 0fe5b36b2a006c1da8e60ee22fc9b9a7efdca643 Mon Sep 17 00:00:00 2001 From: Manan Date: Wed, 17 Mar 2021 09:01:59 +0530 Subject: [PATCH 1/2] Replaced mutable default argument Default arguments shouldn't be mutable - https://stackoverflow.com/questions/1132941/least-astonishment-and-the-mutable-default-argument --- libgravatar/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgravatar/__init__.py b/libgravatar/__init__.py index 1ddad33..06d753a 100644 --- a/libgravatar/__init__.py +++ b/libgravatar/__init__.py @@ -200,8 +200,11 @@ def test(self): """Test the API.""" return self._call('test') - def _call(self, method, params={}): + def _call(self, method, params=None): """Call a method from the API, gets 'grav.' prepended to it.""" + + if params is None: + params = {} args = { 'apikey': self.apikey, From b56187d912f5b8ff3f9732e2fb31dddf59a3c40c Mon Sep 17 00:00:00 2001 From: Manan Date: Wed, 17 Mar 2021 22:25:42 +0530 Subject: [PATCH 2/2] Added name to contributors section --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index f6ea26d..0563ac4 100644 --- a/README.rst +++ b/README.rst @@ -67,3 +67,4 @@ Author and contributors * Pablo SEMINARIO (`@pabluk `_) * Caleb FANGMEIER (`@cfangmeier `_) * Rarm NAGALINGAM (`@snowjet `_) +* Manan (`@mentix02 `_)