From 0413931df5d4bbeeb686224b6911113556a589d0 Mon Sep 17 00:00:00 2001 From: mistermocha Date: Wed, 24 May 2017 11:54:34 -0700 Subject: [PATCH 1/6] Completing functionality for enum.auto Full context: https://github.com/python/mypy/pull/3441 --- stdlib/3.4/enum.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/3.4/enum.pyi b/stdlib/3.4/enum.pyi index a7e0fd686db3..4e90254224b1 100644 --- a/stdlib/3.4/enum.pyi +++ b/stdlib/3.4/enum.pyi @@ -32,8 +32,9 @@ def unique(enumeration: _S) -> _S: ... if sys.version_info >= (3, 6): _auto_null = ... # type: Any - class auto: + class auto(IntFlag): value = ... # type: Any + def __init__(self) -> None: pass class Flag(Enum): def __contains__(self: _T, other: _T) -> bool: ... From f2167ce75955dd75dbf649318f49c2c2b4bbf29c Mon Sep 17 00:00:00 2001 From: mistermocha Date: Wed, 24 May 2017 14:53:47 -0700 Subject: [PATCH 2/6] Update enum.pyi --- stdlib/3.4/enum.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/3.4/enum.pyi b/stdlib/3.4/enum.pyi index 4e90254224b1..fa934e9c6779 100644 --- a/stdlib/3.4/enum.pyi +++ b/stdlib/3.4/enum.pyi @@ -34,7 +34,7 @@ if sys.version_info >= (3, 6): class auto(IntFlag): value = ... # type: Any - def __init__(self) -> None: pass + def __init__(self) -> None: ... class Flag(Enum): def __contains__(self: _T, other: _T) -> bool: ... From ae06a79da62fced3ea35b75dea54ee1e6f8007b8 Mon Sep 17 00:00:00 2001 From: mistermocha Date: Thu, 25 May 2017 22:13:12 -0700 Subject: [PATCH 3/6] Update enum.pyi --- stdlib/3.4/enum.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/3.4/enum.pyi b/stdlib/3.4/enum.pyi index fa934e9c6779..b0cf7f022ab5 100644 --- a/stdlib/3.4/enum.pyi +++ b/stdlib/3.4/enum.pyi @@ -33,6 +33,7 @@ if sys.version_info >= (3, 6): _auto_null = ... # type: Any class auto(IntFlag): + """auto: subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() value = ... # type: Any def __init__(self) -> None: ... From b74065a62fde6c128951516c15994f3e14ca7b38 Mon Sep 17 00:00:00 2001 From: mistermocha Date: Thu, 25 May 2017 22:13:50 -0700 Subject: [PATCH 4/6] Update enum.pyi --- stdlib/3.4/enum.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/3.4/enum.pyi b/stdlib/3.4/enum.pyi index b0cf7f022ab5..2cb07959d481 100644 --- a/stdlib/3.4/enum.pyi +++ b/stdlib/3.4/enum.pyi @@ -33,7 +33,7 @@ if sys.version_info >= (3, 6): _auto_null = ... # type: Any class auto(IntFlag): - """auto: subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() + """auto: subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto()""" value = ... # type: Any def __init__(self) -> None: ... From bda78533b349594711a66298cba7b97c2a3b47c9 Mon Sep 17 00:00:00 2001 From: Brian Weber Date: Fri, 26 May 2017 19:11:25 -0700 Subject: [PATCH 5/6] Runs just fine without `__init__`, removing --- stdlib/3.4/enum.pyi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stdlib/3.4/enum.pyi b/stdlib/3.4/enum.pyi index 2cb07959d481..b8b5ef54dbb4 100644 --- a/stdlib/3.4/enum.pyi +++ b/stdlib/3.4/enum.pyi @@ -32,10 +32,9 @@ def unique(enumeration: _S) -> _S: ... if sys.version_info >= (3, 6): _auto_null = ... # type: Any +# auto: subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() class auto(IntFlag): - """auto: subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto()""" value = ... # type: Any - def __init__(self) -> None: ... class Flag(Enum): def __contains__(self: _T, other: _T) -> bool: ... From 11eea09c1f4e8a541c83244dd4d5cb81015a38c5 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 27 May 2017 14:59:28 -0700 Subject: [PATCH 6/6] fix indentation, remove redundant label --- stdlib/3.4/enum.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/3.4/enum.pyi b/stdlib/3.4/enum.pyi index b8b5ef54dbb4..ecea44716296 100644 --- a/stdlib/3.4/enum.pyi +++ b/stdlib/3.4/enum.pyi @@ -32,7 +32,7 @@ def unique(enumeration: _S) -> _S: ... if sys.version_info >= (3, 6): _auto_null = ... # type: Any -# auto: subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() + # subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() class auto(IntFlag): value = ... # type: Any