-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
We have by now firmly and securely dropped Python 2 support. As of
#4361, all our sources set srcs_version = "PY3", so no Bazel-built py2
binaries may depend on these sources (even Google-internally).
There remain many contortions in our code that are vestiges of the
bicompatibility period. Most of these fall under “mostly harmless, but
should be cleaned up incrementally or eventually”.
Off the top of my head:
- Replace
u"xxx"literals with just"xxx"strings (Upgrade Black to v20.8b1 and drop py27 and py35 #4409) - Replace
box = [None]closure access pattern withnonlocal(Usenonlocalrather thanbox[0]in tests #4482) - Remove now-useless
__future__imports (py3: remove__future__imports #4503) - Use
os.makedirs(exist_ok=True)rather thanEEXISTdances - Remove fallbacks for
sys.stderr.buffer, et al. - Remove fallbacks for
html.escape(py3: usehtml.escapeunconditionally #4515) - Remove the
argparse_utilfallback (py3: removeargparse_utilhelper #4493) - Simplify conditional imports of
unittest.mock(py3: removemockbackport #4507) - Kill the
unittest.mockbackport dependency (py3: removemockbackport #4507) - Replace all usages of
sixwith the idiomatic Python 3 code (pending: py3: excisesix#4510)
Feel free to add more.