brandon-rhodes / python-sgp4

Python version of the SGP4 satellite position library
MIT License
377 stars 88 forks source link

Make setup.py forwards compatible with Python 4 #45

Closed astrojuanlu closed 4 years ago

astrojuanlu commented 4 years ago

Discovered using flake8 --select YTT setup.py (https://github.com/asottile/flake8-2020)

brandon-rhodes commented 4 years ago

The intention of this if statement is to prevent the C code from trying to compile under Python versions other than 3, because Python breaks C-code compatibility with each major version release: you can't expect code written against, say, the Python 2 C API to work against the Python 3 C API.

Therefore, this should not compile against any Python version under than 3, right?

astrojuanlu commented 4 years ago

You're totally right, I didn't realize the upcoming C API breakage. Sorry for the noise!

brandon-rhodes commented 4 years ago

You're totally right, I didn't realize the upcoming C API breakage. Sorry for the noise!

Alas, as Python 3 demonstrated, backwards compatibility cannot be counted on ahead of time :)