Skip to content

RUF055 could support equivalent cases using byte strings #18739

@MeGaGiGaGon

Description

@MeGaGiGaGon

Summary

RUF055 does not trigger when the regex contains a byte string playground

re.sub(rb"x", b"y", b"x")

This could be replaced with

b"x".replace(rb"x", b"y")

I'm unsure if every string replacement would also work for byte string replacement, or if there would be some exceptions.

Version

playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    ruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions