Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PEP 709: Comprehension iteration variable leaks into outer locals() #104619

Closed
Assignees
carljm
Labels
type-bugAn unexpected behavior, bug, or error
@JelleZijlstra

Description

@JelleZijlstra

Code:

def__b():    [__afor__bin [__b]for_in []]returnlocals()

On#104603, calling this gives:

>>> __b(){'__b': <function __b at 0x100e3e390>}

But on 3.11:

>>> __b(){}

So the locals() in the outer function can now include comprehension variables from the inner comprehension. cc@carljm

Linked PRs

Metadata

Metadata

Assignees

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp