Following the drop of Python 2 support in the next release (#11881) and specifically this comment, I am listing some new Python 3 features that can replace some old ones.
New in 3.4
- use the pathlib module for dealing with paths. see PEP428
New in 3.5
- replace os.listdir with the much faster os.scandir. see PEP471
New in 3.6
secrets module to replace os.urandom. see PEP 506
f-strings instead of str.format. see PEP 498