Skip to content

Commit 6e83c64

Browse files
committed
style: simplify default functions that should return {}
1 parent e233d48 commit 6e83c64

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

folium/features.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -373,19 +373,11 @@ def __init__(self, data, style_function=None, name=None,
373373
else:
374374
raise ValueError('Unhandled object {!r}.'.format(data))
375375

376-
if style_function is None:
377-
def style_function(x):
378-
return {}
379-
380-
self.style_function = style_function
376+
self.style_function = style_function or lambda x: {}
381377

382378
self.highlight = highlight_function is not None
383379

384-
if highlight_function is None:
385-
def highlight_function(x):
386-
return {}
387-
388-
self.highlight_function = highlight_function
380+
self.highlight_function = highlight_function or lambda x: {}
389381

390382
self.smooth_factor = smooth_factor
391383

0 commit comments

Comments
 (0)