Python yield generator function

565 views Asked by At

So I've got this ginormous humungous class, of which the only relevant code is:

    def get_col_is_numeric(self, col_name):
        "Returns an iterator with each cell length in the named column"
        min(self.get_col_iter_is_numeric(col_name))

... and I loaded some values into the dict from a csv file.
Problem is that csvDictReaderCol.get_col_is_numeric('Ann_payrll') returns None even though all values in the column are numbers. Why does yield generate a None value?

1

There are 1 answers

0
Winston Ewert On BEST ANSWER

get_col_is_numeric is missing a return statement so it returns None.

Also next time, try just posting the actual functions/methods involved rather then the whole class.