Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update firebase.py #114

Merged
merged 1 commit into from
May 6, 2024
Merged

Update firebase.py #114

merged 1 commit into from
May 6, 2024

Conversation

anonymousdouble
Copy link
Contributor

refactor with fstring to format string to make code more Pythonic.

refactor with fstring to format string to make code more Pythonic.
Copy link

@josueal1 josueal1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -243,8 +243,7 @@ def _build_endpoint_url(self, url, name=None):
url = url + self.URL_SEPERATOR
if name is None:
name = ''
return '%s%s%s' % (urlparse.urljoin(self.dsn, url), name,
self.NAME_EXTENSION)
return f'{urlparse.urljoin(self.dsn, url)}{name}{self.NAME_EXTENSION}'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, more pythonic and the code returns the same result. We can prove with this small test:

url = "https://url.com/"
name = "john"
extension =".jpeg"
# Online Python - IDE, Editor, Compiler, Interpreter

print('%s%s%s' % (url, name,
extension) == (f'{url}{name}{extension}'))

@ozgur ozgur merged commit fd76de2 into ozgur:master May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants