Skip to content

Type inferring can result in Pyright errors that are probably fine #810

Open
@microbit-carlos

Description

@microbit-carlos

Bug Description

Seems like Pyright is doing type inferring, and then reporting errors based on that.
This is probably a "good thing™️", but can result in the editor reporting errors that might be fine during runtime

How To Reproduce

image

def foo(bar=10):
    if bar == None:
        # Do something here if the value is None for some reason
        bar = 0
    return bar * 2

foo(None)

Expected behavior

Not sure if we would want to filter this kind of error, or if there would be a way to filter some of these.

Screenshots

In "How To Reproduce" section.

Environment

N/A

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions