Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork48
Description
In GitLab by@warsaw on Feb 12, 2018, 15:02
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 theonly difference would be that code that needs to straddle multiple versions would just do:
try:fromimportlibimportresourcesexceptImportError:importimportlib_resourcesasresources
(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:fromimportlib.resourcesimport*exceptImportError:fromimportlib_resourcesimport*
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 thesetup.py (or throw an exception on import ifsys.version_info >= (3, 7).
I'm open to other suggestions.