From 5d16680dfe97130a40c4ad50bbd3c4c124398164 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Mon, 3 Feb 2025 14:55:01 +0000 Subject: [PATCH] Add object self-type to tuple test fixture (#18592) This makes it more similar to the real typeshed. It is needed to reproduce tricky failures in tests, e.g. https://github.com/python/mypy/pull/18585. If this causes slower tests, some tests may be switched to `tuple-simple.pyi`. --- test-data/unit/fixtures/tuple.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-data/unit/fixtures/tuple.pyi b/test-data/unit/fixtures/tuple.pyi index 3b62d7fc1513c..d01cd0034d263 100644 --- a/test-data/unit/fixtures/tuple.pyi +++ b/test-data/unit/fixtures/tuple.pyi @@ -1,13 +1,14 @@ # Builtins stub used in tuple-related test cases. import _typeshed -from typing import Iterable, Iterator, TypeVar, Generic, Sequence, Optional, overload, Tuple, Type +from typing import Iterable, Iterator, TypeVar, Generic, Sequence, Optional, overload, Tuple, Type, Self _T = TypeVar("_T") _Tco = TypeVar('_Tco', covariant=True) class object: def __init__(self) -> None: pass + def __new__(cls) -> Self: ... class type: def __init__(self, *a: object) -> None: pass