8000 False positive for disjoint type ranges · Issue #580 · google/pytype · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
False positive for disjoint type ranges #580
Open
@yugr

Description

@yugr

Sorry if that's a known issue.

This code

def visit_goals(lst, f):
    for x in lst:
        f(x)

goals = set()
visit_goals([], lambda g: goals.add(g))

def foo():
    return [1, 2, 3]

goals = foo()
for g in goals:
    print(g)

causes pytype 2020.4.22 to emit

<lambda>: No attribute 'add' on List[int] [attribute-error]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0