Implicit dunder returns are excluded from the typable count even when annotated, but merge_overloads recomputes overload slots and only skips unannotated returns:
from typing import overload
class Plain:
def __init__(self, x: int) -> None: ...
class Overloaded:
@overload
def __init__(self, x: int) -> None: ...
@overload
def __init__(self, x: str) -> None: ...
def __init__(self, x): ...
pyrefly coverage report:
{"name": "Plain.__init__", "n_typable": 1, "n_typed": 1}
{"name": "Overloaded.__init__", "n_typable": 2, "n_typed": 2}
Both should have only 1 typable (the x parameter), because the __init__ return type (viz. None) is trivial, so there's no utility in annotating it.
Implicit dunder returns are excluded from the typable count even when annotated, but
merge_overloadsrecomputes overload slots and only skips unannotated returns:pyrefly coverage report:{"name": "Plain.__init__", "n_typable": 1, "n_typed": 1} {"name": "Overloaded.__init__", "n_typable": 2, "n_typed": 2}Both should have only 1 typable (the
xparameter), because the__init__return type (viz.None) is trivial, so there's no utility in annotating it.