diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2018-03-03 15:40:10 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2018-03-03 15:40:10 +0300 |
commit | 96f1356aeafbdc026846cdbe1bcfcbbbd0ab3a7c (patch) | |
tree | 271e85f93792247725cd19f8064b65c7346acb68 /vk/api.py | |
parent | new platform, "VK Mobile" (diff) | |
download | vk-scripts-96f1356aeafbdc026846cdbe1bcfcbbbd0ab3a7c.tar.gz vk-scripts-96f1356aeafbdc026846cdbe1bcfcbbbd0ab3a7c.zip |
fix Pylint warnings
Diffstat (limited to '')
-rw-r--r-- | vk/api.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -33,7 +33,7 @@ def _filter_empty_params(params, empty_params=False): def _build_url(scheme, host, path, params=None, empty_params=False): if params is None: params = {} - if isinstance(params, Mapping) or isinstance(params, Iterable): + if isinstance(params, (Iterable, Mapping)): params = _filter_empty_params(params, empty_params) params = urllib.parse.urlencode(params) elif isinstance(params, str): @@ -46,10 +46,9 @@ def _build_url(scheme, host, path, params=None, empty_params=False): def _join_param_values(values): if isinstance(values, str): return values - elif isinstance(values, Iterable): + if isinstance(values, Iterable): return ','.join(map(str, values)) - else: - return values + return values def _join_path(base, url): if not base.endswith('/'): @@ -113,7 +112,8 @@ class API: except (ConnectionError, URLError) as e: raise vk.error.APIConnectionError(str(e)) from e - def _filter_response_with_users(self, user_list, deactivated_users=True): + @staticmethod + def _filter_response_with_users(user_list, deactivated_users=True): user_list = map(User.from_api_response, user_list) if deactivated_users: return user_list |