You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mypyc raises AssertionError: Self`0 in NamedTuple subclass
To Reproduce
vector.py
from __future__ importannotationsfromtypingimportTYPE_CHECKING, NamedTuplefromtyping_extensionsimportSelfifTYPE_CHECKING: # pragma: nocoverfromcollections.abcimportIterableclassVector2(NamedTuple):
"""Vector2 Object. Takes an x and a y coordinate."""x: floaty: float@classmethoddeffrom_iter(cls, iterable: Iterable[float]) ->Self:
"""Return new vector from iterable."""returncls(*iter(iterable))
def__neg__(self) ->Self:
"""Return result of negating self components."""returnself.from_iter(-cforcinself)
Bug Report
Mypyc raises AssertionError: Self`0 in NamedTuple subclass
To Reproduce
vector.py
mypyc vector.py
Expected Behavior
Expected no issues
Actual Behavior
Changing the erroring line in question to be
instead results in
Your Environment
mypy 1.11.2 (compiled: yes)
mypy.ini
(and other config files): NonePython 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] on linux
The text was updated successfully, but these errors were encountered: