Can anyone tell me the use of yield keyword in python and what actually it does?

Here is me code what actually I am trying

def _get_child_candidates(self, distance, min_dist, max_dist):

if self._leftchild and distance - max_dist < self._median:

yield self._leftchild

if self._rightchild and distance + max_dist >= self._median:

yield self._rightchild

This is the caller:

result, candidates = [], [self]

while candidates:

node = candidates.pop()

distance = node._get_dist(obj)

if distance <= max_dist and distance >= min_dist:

result.extend(node._values)

candidates.extend(node._get_child_candidates(distance, min_dist, max_dist))

return result

What happens when _get_child_candidates method will be called? The list will be returned or not? A single element? Can it be called again and when subsequent calls stop?