Skip to content

Ambiguous protocol member with value assignment #2925

@lolpack

Description

@lolpack

Assigning a value (not a type annotation) in a Protocol body is ambiguous. Pyrefly should flag this.

from typing import Protocol

class Ambiguous(Protocol):
    x = None
    y = ...

Sandbox: Pyrefly

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions