Tracking
Related
Description
In pyrefly==1.0.0, this minimized version of the from_native overloads reports inconsistent-overload on every one of them.
mypy and pyright are fine with them.
I was shown this example, which seems to not be covered by these tests. So at the very least that needs checking.
If we make some changes like this - a future version of pyrefly might yell less:
-class _AllowLazy(TypedDict, total=False):
- eager_only: Literal[False]
- series_only: Literal[False]
- allow_series: bool | None
+if TYPE_CHECKING:
+ import typing_extensions as te
+ class _AllowLazy(te.TypedDict, total=False):
+ eager_only: Literal[False]
+ series_only: Literal[False]
+ allow_series: bool | None
-class AllowLazy(_AllowLazy, total=False):
- pass_through: bool
+ class AllowLazy(_AllowLazy, total=False, closed=True):
+ pass_through: bool
But this change might require some runtime acrobats, because closed isn't available until (https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-typeddict)
Tasks
Tracking
inconsistent-overloadfalse positives withUnpack[TypedDict]facebook/pyrefly#3566Related
unsoundness/examples/typeddicts/typeddict_argument_unpacking.pyDescription
In
pyrefly==1.0.0, this minimized version of thefrom_nativeoverloads reportsinconsistent-overloadon every one of them.mypyandpyrightare fine with them.I was shown this example, which seems to not be covered by these tests. So at the very least that needs checking.
If we make some changes like this - a future version of
pyreflymight yell less:But this change might require some runtime acrobats, because
closedisn't available until (https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-typeddict)Tasks
mypy/pyrightissues to see if this has been discussedtyfeatures from (Tracking: Adopttyas an (additional) type checker #3409)Unpackand@overloadsupport was in progress when I wrote thisTYPE_CHECKINGtricks play nicely withmkdocstringsTypedDictdefs