Why can you omit the surrounding parentheses for generators in Python when passing it into a function?

前端 未结 1 409
离开以前
离开以前 2020-12-06 18:31

I was just experimenting in Python with different syntax for passing in a generator as an argument to a function, and I realized that although I\'ve been doing this,

1条回答
  •  佛祖请我去吃肉
    2020-12-06 19:23

    I'm sure reading the python grammar will answer that question.

    If you prefer plain English over grammars: PEP-289 explains it.

    0 讨论(0)
提交回复
热议问题