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

GH258: Replaces single quotes with repr in f strings #276

Closed
wants to merge 6 commits into from
Closed

GH258: Replaces single quotes with repr in f strings #276

wants to merge 6 commits into from

Conversation

Weyaaron
Copy link
Collaborator

@Weyaaron Weyaaron commented Jul 7, 2023

This PR aims to update the fstrings present in this repository to use repr() instead of single quotes. I used a regex to find all of these instances.

Closes #258

@MaxDall MaxDall changed the title Replaces single quotes with repr in f strings GH258: Replaces single quotes with repr in f strings Jul 8, 2023
Copy link
Collaborator

@MaxDall MaxDall left a comment

Choose a reason for hiding this comment

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

Unfortunately it wasn't very obvious in the issue but i would prefer !r over repr().

src/fundus/parser/utility.py Outdated Show resolved Hide resolved
src/fundus/scraping/html.py Outdated Show resolved Hide resolved
@Weyaaron
Copy link
Collaborator Author

@MaxDall I merged the latest master, the CI fails because I use a fork. All comments have been resolved.

@@ -70,9 +70,9 @@ def __lt__(self, other):

def __repr__(self):
if instance := self.__self__:
return f"bound {type(self).__name__} of {instance}: {self.__wrapped__} --> '{self.__name__}'"
return f"bound {type(self).__name__} of {instance}: {self.__wrapped__} --> !r{self.__name__}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unfortunately, it seems that you have misused the !r operator. It's supposed to be placed inside the curly braces like this:

... {self.__name__!r}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Has been done.

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.

Use repr for strings within f-strings instead of single quotes.
2 participants