温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有

Walrus in comprehension can leak into PEP 695 scope · Issue #104640 · python/cpython · GitHub

来源:www.github.com

Example: >>> class B: pass ... >>> class X[T]([(x := 3) for _ in range(2)] and B): print(x) ... 3 This is because a walrus in a comprehension assigns to the immediately enclosing scope, which is now the type parameter sc…

以上为公开页面信息摘要,完整内容请前往原网站阅读。

前往原网站阅读全文

热门推荐记录