Skip to content
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

Merged
merged 5 commits into from Jun 26, 2015
Merged

long is also a valid type #57

merged 5 commits into from Jun 26, 2015

Conversation

bennlich
Copy link
Contributor

No description provided.

@bennlich
Copy link
Contributor Author

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?

@frewsxcv
Copy link
Collaborator

There's a couple options you could do:

  1. Add six as a dependency and use six.integer_types
  2. Copy the same check that six does.

Option 2 might be preferred because it seems excessive to pull in a whole dependency just for a simple check

@bennlich
Copy link
Contributor Author

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)
Copy link
Collaborator

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
Copy link
Collaborator

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 #

@bennlich
Copy link
Contributor Author

kk!

frewsxcv added a commit that referenced this pull request Jun 26, 2015
`long` is also a valid type
@frewsxcv frewsxcv merged commit 2940ab7 into jazzband:master Jun 26, 2015
@frewsxcv
Copy link
Collaborator

Thanks for your contribution @bennlich !

💃

@frewsxcv
Copy link
Collaborator

I just published 1.2.1 that includes your changes. Thanks again!

https://pypi.python.org/pypi/geojson/1.2.1

@bennlich
Copy link
Contributor Author

Awesome!

@bennlich bennlich deleted the patch-1 branch June 26, 2015 06:58
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Aug 9, 2015
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants