GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Specialised-self overloads select the first match for a gradual receiver · Issue #5205 · pyrefly-org/pyrefly Open Labels DescriptionDescribe the BugPyrefly 1.3.2 and 1.4.0.dev3 select the first specialised-self overload for from typing import Any, Generic, TypeVar, overload, reveal_type T = TypeVar("T") class Container(Generic[T]): @overload def scalar(self: "Container[int]") -> int: ... @overload def scalar(self: "Container[str]") -> str: ... def scalar(self) -> int | str: raise NotImplementedError @overload def scalar(value: Container[int]) -> int: ... @overload def scalar(value: Container[str]) -> str: ... def scalar(value: Container[Any]) -> int | str: raise NotImplementedError def probe(gradual: Container[Any]) -> None: reveal_type(gradual.scalar()) # int reveal_type(scalar(gradual)) # Unknown Python: 3.12 Expected: handle receiver ambiguity consistently with explicit arguments, Reversing the method overloads changes its result to
Sandbox Link(Only applicable for extension issues) IDE InformationNo response Reacted by Joren Hammudoglu Activity
|
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |