-
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
(Usenonlocal
rather thanbox[0]
in tests #4482) - Remove now-useless
__future__
imports (py3: remove__future__
imports #4503) - Use
os.makedirs(exist_ok=True)
rather thanEEXIST
dances - Remove fallbacks for
sys.stderr.buffer
, et al. - Remove fallbacks for
html.escape
(py3: usehtml.escape
unconditionally #4515) - Remove the
argparse_util
fallback (py3: removeargparse_util
helper #4493) - Simplify conditional imports of
unittest.mock
(py3: removemock
backport #4507) - Kill the
unittest.mock
backport dependency (py3: removemock
backport #4507) - Replace all usages of
six
with the idiomatic Python 3 code (pending: py3: excisesix
#4510)
Feel free to add more.