Python yield generate函数

2 python yield generator yield-keyword yield-return

所以我有这个巨大的幽默类,其中唯一相关的代码是:

    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))
Run Code Online (Sandbox Code Playgroud)

...我从csv文件中将一些值加载到dict中.
问题是csvDictReaderCol.get_col_is_numeric('Ann_payrll')返回None,即使列中的所有值都是数字.为什么yield会产生None值?

Win*_*ert 7

get_col_is_numeric缺少一个return语句,因此返回None.

还有下一次,尝试发布所涉及的实际功能/方法而不是整个类.