Skip to content

Commit d5d72b6

Browse files
committed
Relaxing data type restriction for Map location param.
1 parent eb001d9 commit d5d72b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

folium/folium.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def __init__(self, location=None, width='100%', height='100%',
231231
self._png_image = None
232232
self.png_enabled = png_enabled
233233

234-
if not location:
234+
if location is None:
235235
# If location is not passed we center and zoom out.
236236
self.location = [0, 0]
237237
self.zoom_start = 1

folium/utilities.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def _validate_location(location):
2828
if _isnan(location):
2929
raise ValueError('Location values cannot contain NaNs, '
3030
'got {!r}'.format(location))
31-
if type(location) not in [list, tuple]:
32-
raise TypeError('Expected tuple/list for location, got '
31+
if isinstance(type(location), collections.abc.Iterable):
32+
raise TypeError('Expected Iterable object for location, got '
3333
'{!r}'.format(location))
3434

3535
if len(location) != 2:

0 commit comments

Comments
 (0)