Skip to content

[uba] Fix new false negative from #10034 #10069

Closed
@jacobtylerwalls

Description

@jacobtylerwalls
def nonlocal_in_outer_frame_ok(callback, condition_a, condition_b):
    def outer():
        nonlocal callback
        def inner():
            if condition_a:
                def inner2():
                    callback()  # possibly-used-before-assignment?
                inner2()
            else:
                if condition_b:
                    def callback():
                        pass
        inner()
    outer()

we should probably raise a message here?

Originally posted by @zenlyj in #10034 (comment)

Metadata

Metadata

Assignees

Labels

Blocker 🙅Blocks the next releaseC: used-before-assignmentIssues related to 'used-before-assignment' checkFalse Negative 🦋No message is emitted but something is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationUnreleased

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions