logo
  • 教程列表
  • SO官方文檔
  • Iterables 和 Iterators
    • Iterator vs Iterable vs Generator
    • 逐個提取值
    • 迭代整個可迭代
    • 僅驗證 iterable 中的一個元素
    • 什麼是可迭代的
    • 迭代器不是可重入的
  1. StackOverflow 文件
  2. Python Language 教程
  3. Iterables 和 Iterators
  4. 迭代器不是可重入的

迭代器不是可重入的

Created: November-22, 2018

def gen():
    yield 1

iterable = gen()
for a in iterable:
    print a

# What was the first item of iterable? No way to get it now.
# Only to get a new iterator
gen()
  • 什麼是可迭代的

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明