line.split() for line in open(mycorpora.txt)会返回一个generator给corpora.Dictionary.
We can use the generator expressions as arguments to various functions
that consume iterators.
sum(((x*x for x in range(10))) 285
When there is only one argument to the calling function, the
parenthesis around generator expression
can be omitted.
open不会for ... in不会文件读取貌似只有
open(xxx).read()会一次性读完整个文件内容,其他方式(readlines之类的)都不会但是
corpora.Dictionary是什么行为就不清楚了line.split() for line in open(mycorpora.txt)会返回一个generator给corpora.Dictionary.而
open函数只是给你个handle,他可不知道你要去读还是写。