From b8c51b9bff12bff44fd428cac67799fa3afef910 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 28 Dec 2021 17:11:37 +0000 Subject: [PATCH 1/2] DO-NOT-MERGE: Use Type Alias instead of import in `csv.pyi` I came across a mypy bug while working on #6717; this PR is just so that I can get a good repro for a bug report to mypy. --- stdlib/csv.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index 3211e688a309..ae68403ac859 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -21,7 +21,7 @@ from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence from typing import Any, Generic, Type, TypeVar, overload if sys.version_info >= (3, 8): - from builtins import dict as _DictReadMapping + _DictReadMapping = dict else: from collections import OrderedDict as _DictReadMapping From d6ed4ece7762537ccd158cd7ef786f89dbb2f288 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 28 Dec 2021 17:32:49 +0000 Subject: [PATCH 2/2] Update csv.pyi --- stdlib/csv.pyi | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index ae68403ac859..fac3bae7e675 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -20,11 +20,7 @@ from _csv import ( from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence from typing import Any, Generic, Type, TypeVar, overload -if sys.version_info >= (3, 8): - _DictReadMapping = dict -else: - from collections import OrderedDict as _DictReadMapping - +_DictReadMapping = dict _T = TypeVar("_T") class excel(Dialect):