Skip to content

(🐞) False except contains Any when inside a function that references a variable that is defined after the function and has an inferred type #13167

Closed
@KotlinIsland

Description

@KotlinIsland
def f():
    a
    try:
        pass
    except Exception as ex:  # error: Expression has type "Any"  [misc]
        pass


a = 1 + 1

playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-disallow-anyThe disallow-any-* family of flags

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions