@@ -26,6 +26,7 @@ print(list(reversed(A())))
26
26
[[3, 2, 1]
27
27
[['c', 'b', 'a']
28
28
[['f', 'o', 'o']
29
+ -- ]]]]]
29
30
30
31
[case testIntAndFloatConversion]
31
32
from typing import SupportsInt, SupportsFloat
@@ -90,6 +91,7 @@ import typing
90
91
print(list.__add__([1, 2], [3, 4]))
91
92
[out]
92
93
[[1, 2, 3, 4]
94
+ -- ]
93
95
94
96
[case testInheritedClassAttribute]
95
97
import typing
@@ -1047,7 +1049,7 @@ _testTypedDictGet.py:9: error: TypedDict "D" has no key 'z'
1047
1049
_testTypedDictGet.py:10: error: All overload variants of "get" of "Mapping" require at least one argument
1048
1050
_testTypedDictGet.py:10: note: Possible overload variants:
1049
1051
_testTypedDictGet.py:10: note: def get(self, k: str) -> object
1050
- _testTypedDictGet.py:10: note: def [_T] get(self, k: str, default: object) -> object
1052
+ _testTypedDictGet.py:10: note: def [_T] get(self, k: str, default: object) -> object
1051
1053
_testTypedDictGet.py:12: error: Revealed type is 'builtins.object*'
1052
1054
1053
1055
[case testTypedDictMappingMethods]
@@ -1317,3 +1319,24 @@ def g(ms: 'T[M]') -> None:
1317
1319
reduce(f, ms)
1318
1320
T = Iterable
1319
1321
[out]
1322
+
1323
+ [case testNamedTupleNew]
1324
+ # This is an eval test because there was a snag found only with full stubs
1325
+ from typing import NamedTuple
1326
+
1327
+ Base = NamedTuple('Base', [('param', int)])
1328
+
1329
+ class Child(Base):
1330
+ def __new__(cls, param: int = 1) -> 'Child':
1331
+ return Base.__new__(cls, param)
1332
+
1333
+ Base(param=10)
1334
+ Child(param=10)
1335
+ reveal_type(Child())
1336
+
1337
+ from collections import namedtuple
1338
+ X = namedtuple('X', ['a', 'b'])
1339
+ x = X(a=1, b='s')
1340
+
1341
+ [out]
1342
+ _testNamedTupleNew.py:12: error: Revealed type is 'Tuple[builtins.int, fallback=_testNamedTupleNew.Child]'
0 commit comments