Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (20 sloc) 850 Bytes
from geopy.point import Point
class Location(object):
def __init__(self, name="", point=None, attributes=None, **kwargs): = name
if point is not None:
self.point = Point(point)
if attributes is None:
attributes = {}
self.attributes = dict(attributes, **kwargs)
def __getitem__(self, index):
"""Backwards compatibility with geopy 0.93 tuples."""
return (, self.point)[index]
def __repr__(self):
return "Location(%r, %r)" % (, self.point)
def __iter__(self):
return iter((, self.point))
def __eq__(self, other):
return (, self.point) == (, other.point)
def __ne__(self, other):
return (, self.point) != (, other.point)
Something went wrong with that request. Please try again.