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
Copy file name to clipboardExpand all lines: mypyc/test-data/irbuild-classes.test
+50-24Lines changed: 50 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -2091,35 +2091,48 @@ class InterpSub:
2091
2091
2092
2092
[case testUnsupportedGetAttr]
2093
2093
from mypy_extensions import mypyc_attr
2094
-
from typing import Optional
2095
2094
2096
2095
@mypyc_attr(allow_interpreted_subclasses=True)
2097
2096
class AllowsInterpreted:
2098
-
def __getattr__(self, attr: str) -> Optional[object]: # E: "__getattr__" not supported in class "AllowsInterpreted" because it allows interpreted subclasses
2097
+
def __getattr__(self, attr: str) -> object: # E: "__getattr__" not supported in class "AllowsInterpreted" because it allows interpreted subclasses
2099
2098
return 0
2100
2099
2101
2100
class InheritsInterpreted(dict):
2102
-
def __getattr__(self, attr: str) -> Optional[object]: # E: "__getattr__" not supported in class "InheritsInterpreted" because it inherits from an interpreted class
2101
+
def __getattr__(self, attr: str) -> object: # E: "__getattr__" not supported in class "InheritsInterpreted" because it inherits from a non-native class
2102
+
return 0
2103
+
2104
+
@mypyc_attr(native_class=False)
2105
+
class NonNative:
2106
+
pass
2107
+
2108
+
class InheritsNonNative(NonNative):
2109
+
def __getattr__(self, attr: str) -> object: # E: "__getattr__" not supported in class "InheritsNonNative" because it inherits from a non-native class
0 commit comments