-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
long
is also a valid type
#57
Conversation
Ahhh drat I forgot they removed the long type in python 3. Is there a way to only do this check in python 2.7? |
There's a couple options you could do:
Option 2 might be preferred because it seems excessive to pull in a whole dependency just for a simple check |
Errr, weird. The six check didn't seem to work? |
# Python 3.x has no long type | ||
JSON_compliant_types = (float, int, Decimal) | ||
else: | ||
JSON_compliant_types = (float, int, Decimal, long) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try changing this to:
JSON_compliant_types = (float, int, Decimal, long) # noqa
flake8 is throwing the error about long
not existing in Python 3. # noqa
tells flake8 to not report errors on this line. Sorta hacky, but it should work for now
# Python 3.x has no long type | ||
JSON_compliant_types = (float, int, Decimal) | ||
else: | ||
JSON_compliant_types = (float, int, Decimal, long) # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There need to be two spaces before the #
kk! |
Thanks for your contribution @bennlich ! 💃 |
I just published 1.2.1 that includes your changes. Thanks again! |
Awesome! |
1.2.2 (2015-07-13) ------------------ - Fix tests by including test file into build - jazzband/geojson#61 - Build universal wheels - https://packaging.python.org/en/latest/distributing.html#universal-wheels 1.2.1 (2015-06-25) ------------------ - Encode long types correctly with Python 2.x - jazzband/geojson#57 1.2.0 (2015-06-19) ------------------ - Utility function to validate GeoJSON objects - jazzband/geojson#56 1.1.0 (2015-06-08) ------------------ - Stop outputting invalid GeoJSON value id=null on Features - jazzband/geojson#53
No description provided.