Why does a Python iterator need a dunder iter function?

前端 未结 0 788
栀梦
栀梦 2021-01-21 01:18

According to the documentation, a container that needs to be iterable should supply an __iter__() function to return an iterator. The iterator itself is required to

相关标签:
回答
  • 消灭零回复
提交回复
热议问题