html.unescape seems to accept optional semicolon on escaping HTML numeric entity. I’ve searched (maybe too few) resources and didn’t find any reasoning behind this (can be similar to #85050)
html.unescape
import html t = "A foo" print(t) # A foo
Tested on Python 3.10 macOS Apple ARM
Try it out in a browser, you’ll find that all major browsers do as well. Browsers are often pretty forgiving, so it may be that unescape mimics that.
unescape
EDIT: I’ll admit I haven’t bothered to track down if that is in a spec somewhere, I simply verified that this is the way browsers currently behave.