From cee4f57011fe822fa6422ca1faa3fa48ea22566a Mon Sep 17 00:00:00 2001 From: MapleCCC Date: Fri, 4 Jun 2021 01:05:50 +0800 Subject: [PATCH 1/2] Add `__all__` to `__future__.pyi` --- stdlib/__future__.pyi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/stdlib/__future__.pyi b/stdlib/__future__.pyi index a68183dbe23e..d9473d48e98a 100644 --- a/stdlib/__future__.pyi +++ b/stdlib/__future__.pyi @@ -21,3 +21,17 @@ if sys.version_info >= (3, 7): annotations: _Feature all_feature_names: List[str] # undocumented + +__all__ = [ + "all_feature_names", + "absolute_import", + "division", + "generators", + "nested_scopes", + "print_function", + "unicode_literals", + "with_statement", + "barry_as_FLUFL", + "generator_stop", + "annotations", +] From 66beeabb6a4e97abc13741671ac417c8d5b0a60a Mon Sep 17 00:00:00 2001 From: MapleCCC Date: Fri, 4 Jun 2021 01:21:41 +0800 Subject: [PATCH 2/2] Add version conditional logic for whether to include `annotations` in `__all__` --- stdlib/__future__.pyi | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/stdlib/__future__.pyi b/stdlib/__future__.pyi index d9473d48e98a..4658afa9f09e 100644 --- a/stdlib/__future__.pyi +++ b/stdlib/__future__.pyi @@ -22,16 +22,30 @@ if sys.version_info >= (3, 7): all_feature_names: List[str] # undocumented -__all__ = [ - "all_feature_names", - "absolute_import", - "division", - "generators", - "nested_scopes", - "print_function", - "unicode_literals", - "with_statement", - "barry_as_FLUFL", - "generator_stop", - "annotations", -] +if sys.version_info >= (3, 7): + __all__ = [ + "all_feature_names", + "absolute_import", + "division", + "generators", + "nested_scopes", + "print_function", + "unicode_literals", + "with_statement", + "barry_as_FLUFL", + "generator_stop", + "annotations", + ] +else: + __all__ = [ + "all_feature_names", + "absolute_import", + "division", + "generators", + "nested_scopes", + "print_function", + "unicode_literals", + "with_statement", + "barry_as_FLUFL", + "generator_stop", + ]