When is it better to use zip instead of izip?

后端 未结 4 467
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 22:22

When is it better to use zip instead of itertools.izip?

4条回答
  •  青春惊慌失措
    2020-11-28 22:44

    When you know you'll want the full list of items constructed (for instance, for passing to a function that would modify that list in-place). Or when you want to force the arguments you're passing to zip() to be completely evaluated at that specific point.

提交回复
热议问题