Skip to content

Commit a20c884

Browse files
committed
Remove Self from file imported into interpreted file
1 parent 1b7b77b commit a20c884

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

mypyc/test-data/run-classes.test

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3394,15 +3394,14 @@ Add(1, 0)=1
33943394
[case testInheritedDunderNew]
33953395
from __future__ import annotations
33963396
from mypy_extensions import mypyc_attr
3397-
from typing import Self
33983397

33993398
from m import interpreted_subclass
34003399

34013400
@mypyc_attr(allow_interpreted_subclasses=True)
34023401
class Base:
34033402
val: int
34043403

3405-
def __new__(cls, val: int) -> Self:
3404+
def __new__(cls, val: int):
34063405
obj = super().__new__(cls)
34073406
obj.val = val + 1
34083407
return obj
@@ -3411,7 +3410,7 @@ class Base:
34113410
self.init_val = val
34123411

34133412
class Sub(Base):
3414-
def __new__(cls, val: int) -> Self:
3413+
def __new__(cls, val: int):
34153414
return super().__new__(cls, val + 1)
34163415

34173416
def __init__(self, val: int) -> None:
@@ -3426,7 +3425,7 @@ class SubWithoutNew(Base):
34263425
class BaseWithoutInterpretedSubclasses:
34273426
val: int
34283427

3429-
def __new__(cls, val: int) -> Self:
3428+
def __new__(cls, val: int):
34303429
obj = super().__new__(cls)
34313430
obj.val = val + 1
34323431
return obj
@@ -3435,7 +3434,7 @@ class BaseWithoutInterpretedSubclasses:
34353434
self.init_val = val
34363435

34373436
class SubNoInterpreted(BaseWithoutInterpretedSubclasses):
3438-
def __new__(cls, val: int) -> Self:
3437+
def __new__(cls, val: int):
34393438
return super().__new__(cls, val + 1)
34403439

34413440
def __init__(self, val: int) -> None:
@@ -3514,6 +3513,8 @@ def interpreted_subclass(base) -> None:
35143513
assert s2.val == 43
35153514
assert s2.init_val == 84
35163515

3516+
[typing fixtures/typing-full.pyi]
3517+
35173518
[case testDunderNewInitArgMismatch]
35183519
from __future__ import annotations
35193520
from testutil import assertRaises

0 commit comments

Comments
 (0)