Skip to content

[ruff] Formatting hex codes changes output with f-string debug #14766

@MeGaGiGaGon

Description

@MeGaGiGaGon

I had this idea while reading psf/black#4522 when @MichaReiser said ruff had already stabilized hex code formatting.

I don't actively use ruff/am not familiar with it, but I assume that just like black formatting code should not have an observable runtime effect.

playground link formatting f"{r'\xFF'=}" gives f"{r'\xff'=}"

>>> f"{r"\xFF"=}"
'r"ÿ"=\'\\\\xFF\''
>>> f"{r"\xff"=}"
'r"ÿ"=\'\\\\xff\''

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingformatterRelated to the formatter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions