From 3bc363ab00aa9d4dbadddf80de975c5cf5f2ba67 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 27 Nov 2021 14:21:02 +0000 Subject: [PATCH 1/4] Add missing `__version__` attribute to `csv.pyi` --- stdlib/_csv.pyi | 1 + stdlib/csv.pyi | 1 + 2 files changed, 2 insertions(+) diff --git a/stdlib/_csv.pyi b/stdlib/_csv.pyi index 1dc43780f687..6737c5477850 100644 --- a/stdlib/_csv.pyi +++ b/stdlib/_csv.pyi @@ -1,5 +1,6 @@ from typing import Any, Iterable, Iterator, List, Protocol, Type, Union +__version__: str QUOTE_ALL: int QUOTE_MINIMAL: int QUOTE_NONE: int diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index 0b69cb2272d3..8f44b9798f72 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -1,5 +1,6 @@ import sys from _csv import ( + __version__ as __version__, QUOTE_ALL as QUOTE_ALL, QUOTE_MINIMAL as QUOTE_MINIMAL, QUOTE_NONE as QUOTE_NONE, From 9dc2a7596e74d651a9a7b4c43fd4c058f63888f7 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 27 Nov 2021 14:38:58 +0000 Subject: [PATCH 2/4] Revert changes --- stdlib/_csv.pyi | 1 - stdlib/csv.pyi | 1 - 2 files changed, 2 deletions(-) diff --git a/stdlib/_csv.pyi b/stdlib/_csv.pyi index 6737c5477850..1dc43780f687 100644 --- a/stdlib/_csv.pyi +++ b/stdlib/_csv.pyi @@ -1,6 +1,5 @@ from typing import Any, Iterable, Iterator, List, Protocol, Type, Union -__version__: str QUOTE_ALL: int QUOTE_MINIMAL: int QUOTE_NONE: int diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index 8f44b9798f72..0b69cb2272d3 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -1,6 +1,5 @@ import sys from _csv import ( - __version__ as __version__, QUOTE_ALL as QUOTE_ALL, QUOTE_MINIMAL as QUOTE_MINIMAL, QUOTE_NONE as QUOTE_NONE, From 4b9b41510dec92f90333e88f1772f424098c8bac Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 27 Nov 2021 14:41:57 +0000 Subject: [PATCH 3/4] Add useful explanatory comments --- stdlib/_csv.pyi | 3 +++ stdlib/csv.pyi | 3 +++ 2 files changed, 6 insertions(+) diff --git a/stdlib/_csv.pyi b/stdlib/_csv.pyi index 1dc43780f687..c4b42dbc3ffd 100644 --- a/stdlib/_csv.pyi +++ b/stdlib/_csv.pyi @@ -1,5 +1,8 @@ from typing import Any, Iterable, Iterator, List, Protocol, Type, Union +# __version__ is deliberately not defined here or in _csv.pyi, +# as it appears to have been hardcoded at "1.0" for a very long time! + QUOTE_ALL: int QUOTE_MINIMAL: int QUOTE_NONE: int diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index 0b69cb2272d3..60dc597f0d81 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -25,6 +25,9 @@ if sys.version_info >= (3, 8): else: from collections import OrderedDict as _DictReadMapping +# __version__ is deliberately not defined here or in _csv.pyi, +# as it appears to have been hardcoded at "1.0" for a very long time! + _T = TypeVar("_T") class excel(Dialect): From 6ff28a3496ca5bd39dcb33ea5092ea7540edb93e Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 27 Nov 2021 14:44:52 +0000 Subject: [PATCH 4/4] Update stdlib/_csv.pyi Co-authored-by: Akuli --- stdlib/_csv.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/_csv.pyi b/stdlib/_csv.pyi index c4b42dbc3ffd..4329a875b058 100644 --- a/stdlib/_csv.pyi +++ b/stdlib/_csv.pyi @@ -1,6 +1,6 @@ from typing import Any, Iterable, Iterator, List, Protocol, Type, Union -# __version__ is deliberately not defined here or in _csv.pyi, +# __version__ is deliberately not defined here or in csv.pyi, # as it appears to have been hardcoded at "1.0" for a very long time! QUOTE_ALL: int