Title: html.escape can be used in a few places in the standard lib instead of similar existing code
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.11
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: andrei.avk, ezio.melotti
Priority: normal Keywords:

Created on 2021-06-20 03:40 by andrei.avk, last changed 2021-06-26 13:22 by terry.reedy.

Messages (1)
msg396161 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-06-20 03:40
There are a few places where old code does essentially the same thing as `html.escape()`, and can be replaced with html.escape():

 - more readable
 - less error prone on refactorings
 - will benefit if html.escape() performance is improved in the future
 - will be easier to grep for in case in the future html.escape() is enhanced with new escapes & it will be useful to consider applying it to all instances where it is used.

Here's what I found:

(^ keep existing escape of double quote)

I can add a PR if this sounds good.
Date User Action Args
2021-06-26 13:22:26terry.reedysetnosy: + ezio.melotti
2021-06-20 03:40:30andrei.avkcreate