Skip to content

Look at flake8 B028 #553

@enzbang

Description

@enzbang

Flake8 flags some code with the B028 check:

B028: Consider replacing f"'{foo}'" with f"{foo!r}" which is both easier to read and will escape quotes inside foo if that would appear. The check tries to filter out any format specs that are invalid together with !r. If you're using other conversion flags then e.g. f"'{foo!a}'" can be replaced with f"{ascii(foo)!r}". Not currently implemented for python<3.8 or str.format() calls.

Code should be rewritten following that advice or we should make the decision to ignore that warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueSmall task that can be performed by new or casual contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions