Implemented next() and __next__ methods on DynamicMap
@@ -1213,6 +1213,13 @@ class DynamicMap(HoloMap):
raise NotImplementedError('Cannot add dimensions to a DynamicMap, '
'cast to a HoloMap first.')
+ def next(self):
+ if self.callback.noargs:
+ return self[()]
+ else:
+ raise Exception('The next method can only be used for DynamicMaps using'
+ 'generators (or callables without arguments)')
+
# For Python 2 and 3 compatibility
__next__ = next
