Difference between yield in Python and yield in C#

前端 未结 4 768
迷失自我
迷失自我 2021-02-05 03:14

What is the difference between yield keyword in Python and yield keyword in C#?

4条回答
  •  失恋的感觉
    2021-02-05 03:42

    C#'s yield return is equivalent to Python's yield , and yield break is just return in Python.

    Other than those minor differences, they have basically the same purpose.

提交回复
热议问题