Standardise on one approach to numeric parsing, drop Long support from Python 2.x #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously there was a mix of define-based polyfill and explicit version checking.
This change canonicalizes upon the latter, always using PyInt under Python 2.x and PyLong under 3.x.
As such this change will remove implicit compatibility with Long datatypes from the Python 2.x version of this library.
Since this (possibly unintended) compatibility witgh Python 2.x long types led to unexpected behaviour (see #34) it seems sensible to remove it and favour a TypeError.
Additionally, SPI doesn't support the transmission of any one value that might be represented by a Long in Python 2.x so this support was redundant.
I have also included a new folder of tests which run under both Python 2.x and Python 3.x. These are intended to validate (some not all) functionality of the spidev library and help avoid regressions (such as the one I introduced in #93 and discuss in #97). The included README.md documents, somewhat, how to run these properly.
This PR is raised as a draft because it's a bit meaty and potentially controversial. These tests are also incomplete and unable to run in a CI environment- that's something we should look into fixing.