jazzband / geojson

Python bindings and utilities for GeoJSON
https://pypi.python.org/pypi/geojson/
BSD 3-Clause "New" or "Revised" License
905 stars 120 forks source link

loads() returns inconsistent types #105

Open medwig opened 6 years ago

medwig commented 6 years ago

python -c "import geojson; geojson.loads('{}').is_valid" AttributeError: 'dict' object has no attribute 'is_valid'

If loads(x) succeeds it returns a geojson.feature.____ object, otherwise it returns the result of json.loads(x).

I recommend it always return a feature object.

frewsxcv commented 6 years ago

Sounds good to me, though we'll need to do a major version bump for this, which is fine