在Python3中,许多方法返回迭代器或生成器对象(而不是python2中的列表或其他重对象)。但是,我发现拆分字符串仍然返回list,而不是generator或iteator:Python 3.2.2>>> type('a b c d'.split())是否内置了使用generator或iterator拆分<em
有人能解释一下python 2.7.8上的这种行为吗?Python 2.7.8 (default, Nov 12 2014, 02:03:09)Typecredits" or "license" for more information.>>> a.split()>>> a.split('\n')
[