jonthornton / MTAPI

JSON proxy server for the MTA's realtime New York City subway feed
283 stars 83 forks source link

Fix get_by_point for python 3 #14

Closed mmeyer724 closed 5 years ago

mmeyer724 commented 5 years ago

In Python 3, calling values() on a dict returns dict_values, which does not support the sort method. This leads to the following error under Python 3: AttributeError: 'dict_values' object has no attribute 'sort'

Additionally, map now returns a generator instead of a list, so the [:] slice syntax doesn't work 🙁: TypeError: 'map' object is not subscriptable

I addressed this by using itertool's islice function instead.

jonthornton commented 5 years ago

Thank you!