But if a return is encountered, it causes the produced generator to raise a StopIteration exception rather than yield further values.
但如果遇到return,它导致产生的生成器抛出StopIteration异常,而不是进一步生成值。
A generator "returns" with the new keyword yield, but "remembers" the exact point of execution where it returned.
生成器“返回”时带关键字yield,但“记住”了它“返回”的所有确切执行位置。
Every yield encountered becomes a return value for generator's.next method. Let's look at the simplest generator to make things clear.
遇到的每个yield都成为生成器的. next方法的返回值。
What makes a function a generator factory in Python 2.2 + is the presence of one or more yield statements somewhere in its body.
在Python 2.2 +中使函数成为生成器工厂是它主体某处的一个或多个yield语句。
Technical properties of the ozone generator have been determined and effects of various technical factors on the ozone yield have been studied.
测定了这种臭氧发生器的技术性能,探讨了不同工艺因素对于臭氧产率的影响。
By using RQMD Monte Carlo generator model, we performed an investigation on the yield ratio of various particles in relativistic heavy ion collisions in high energy physics.
本文用RQMD模型对高能物理中的相对论重粒子碰撞中的各种粒子的产额比进行了研究。
By using RQMD Monte Carlo generator model, we performed an investigation on the yield ratio of various particles in relativistic heavy ion collisions in high energy physics.
本文用RQMD模型对高能物理中的相对论重粒子碰撞中的各种粒子的产额比进行了研究。
应用推荐