Skip to content

Comments

Use format strings and raw strings#2554

Open
Arusekk wants to merge 3 commits intoGallopsled:devfrom
Arusekk:fmt-raw
Open

Use format strings and raw strings#2554
Arusekk wants to merge 3 commits intoGallopsled:devfrom
Arusekk:fmt-raw

Conversation

@Arusekk
Copy link
Member

@Arusekk Arusekk commented Feb 28, 2025

Now that we require py3.6 we can use good things to our advantage. This PR aims to reduce code and make it readable with no functional change.

Copy link
Member

@peace-maker peace-maker left a comment

Choose a reason for hiding this comment

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

Nice. f-strings!

return x


def hexstr(s, force=False):
Copy link
Member

Choose a reason for hiding this comment

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

Can you add documentation and tests for this too please?

" To remove the existing entry from your known_hosts and trust the new key, run the following commands:\n"
" $ ssh-keygen -R %(host)s\n"
" $ ssh-keygen -R [%(host)s]:%(port)s" % locals())
" $ ssh-keygen -R {host}\n"
Copy link
Member

Choose a reason for hiding this comment

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

I think this needs to be an f-string itself.

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.

2 participants