tensorflow / tensorflow/tensorboard
Replace py2isms with py3
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 1
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 (#4409) - Replace
box = [None]closure access pattern withnonlocal(#4482) - Remove now-useless
__future__imports (#4503) - Use
os.makedirs(exist_ok=True)rather thanEEXISTdances - Remove fallbacks for
sys.stderr.buffer, et al. - Remove fallbacks for
html.escape(#4515) - Remove the
argparse_utilfallback (#4493) - Simplify conditional imports of
unittest.mock(#4507) - Kill the
unittest.mockbackport dependency (#4507) - Replace all usages of
sixwith the idiomatic Python 3 code (pending: #4510)
Feel free to add more.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names several remaining Python 3 cleanup areas but no specific files or tests. Choose one unchecked item, locate its usages in the sources, and confirm that the selected Python 2 compatibility code is removed without changing supported Python 3 behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100