Disable or shadow package for Python 3.7
I've been thinking about Python 3.7 support (really >= 3.7), since I'm working on sync'ing the APIs with what's in the stdlib. It's actually a little difficult to get 100% coverage for 3.7 without going through a bunch of hoops that make the code uglier. That got me to asking, should we even support >= 3.7 for the standalone package?
We actually don't need to, since the only difference would be that code that needs to straddle multiple versions would just do:
try:
from importlib import resources
except ImportError:
import importlib_resources as resources
(or similar of course, if you only need some functions out of the module).
The other option would be to shadow the stdlib bits, by doing something like:
try:
from importlib.resources import *
except ImportError:
from importlib_resources import *
Or some such. I think I prefer the first approach, i.e. document what straddling code should do. Then I'd delete all the workarounds for 3.7, and actually prevent installation in the setup.py
(or throw an exception on import if sys.version_info >= (3, 7)
.
I'm open to other suggestions.