Skip to content

Format \N unicode escapes #2828

@TomFryers

Description

@TomFryers

Describe the style change

Black could have an opinion of the correct case for \N unicode escapes. For examples, formatting \N{ox} to \N{OX}.

Examples in the current Black style

# This is not nice. All oxen should look the same.
print("\N{ox}\N{OX}")

Desired style

# Now the oxen will be happier.
print("\N{OX}\N{OX}")

Upper-case is standard for these, I believe. (For example, in the Python docs.)

This is related to issue number 2067.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: styleWhat do we want Blackened code to look like?

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions