open-location-code
open-location-code copied to clipboard
Python needs to be ported to Python 3
As is, the Python module does not work in Python 3.7, and Python 2 will be officially deprecated in two weeks (1st January 2020). I have tried a number of things to get it to work, but to no avail.
Hey @SWalkerTTU, our Python library already runs properly on Python 3.6 (tested continuously).
Do you have more details on what isn't working in Python 3.7? Could it be a configuration issue?
I've narrowed it down a bit more. The code in the Git repository passes its test on 3.8, but importing the pip package in 3.8 isn't working; the methods don't show up with openlocationcode.dict on 3.8, but do on 2.7.
@zongweil I was unable to resolve functions defined in openlocationcode after installing via pip and importing it in the standard way using import openlocationcode or from openlocationcode import *. Instead, I had to either...
- use
from openlocationcode.openlocationcode import *which seems less-than-idiomatic, or... - edit the
__init__.pyfile of the package and changefrom openlocationcode import *to__all__ = ["openlocationcode"]and then import in the standard fashion:from openlocationcode import *
This is with 3.8.1. I haven't checked other versions.
Recommended tag: implementation