aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vk/api.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vk/api.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/vk/api.py b/vk/api.py
index 392d4b8..f9df904 100644
--- a/vk/api.py
+++ b/vk/api.py
@@ -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