@@ -26,6 +26,7 @@ print(list(reversed(A())))
2626[[3, 2, 1]
2727[['c', 'b', 'a']
2828[['f', 'o', 'o']
29+ -- ]]]]]
2930
3031[case testIntAndFloatConversion]
3132from typing import SupportsInt, SupportsFloat
@@ -90,6 +91,7 @@ import typing
9091print(list.__add__([1, 2], [3, 4]))
9192[out]
9293[[1, 2, 3, 4]
94+ -- ]
9395
9496[case testInheritedClassAttribute]
9597import typing
@@ -1047,7 +1049,7 @@ _testTypedDictGet.py:9: error: TypedDict "D" has no key 'z'
10471049_testTypedDictGet.py:10: error: All overload variants of "get" of "Mapping" require at least one argument
10481050_testTypedDictGet.py:10: note: Possible overload variants:
10491051_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
10511053_testTypedDictGet.py:12: error: Revealed type is 'builtins.object*'
10521054
10531055[case testTypedDictMappingMethods]
@@ -1317,3 +1319,24 @@ def g(ms: 'T[M]') -> None:
13171319 reduce(f, ms)
13181320T = Iterable
13191321[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