Skip to content

Commit ce40017

Browse files
committed
use string formatting
1 parent f91ccad commit ce40017

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ def compose_url(self, api, version_number):
2222
Returns the uri for an endpoint as a string
2323
"""
2424
version = self.format_version_string(version_number)
25-
url = self.base_url + version + "/" + api
26-
return url
25+
return '{}{}/{}'.format(self.base_url, version, api)
2726

2827
@staticmethod
2928
def format_version_string(version_number):
3029
"""
3130
Returns a string representation of the API version
3231
"""
33-
version = "v" + str(version_number)
34-
return version
32+
return '{}v'.format(version_number)

0 commit comments

Comments
 (0)