From 8b0d666c889bc34bd94a5e96d807dbad694ff434 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 22 Apr 2017 16:42:09 -0700 Subject: [PATCH] Add missing enum attributes Fixes #854 (unless there's more I'm missing). --- stdlib/3.4/enum.pyi | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/stdlib/3.4/enum.pyi b/stdlib/3.4/enum.pyi index 51f4fa5317ec..a7e0fd686db3 100644 --- a/stdlib/3.4/enum.pyi +++ b/stdlib/3.4/enum.pyi @@ -1,11 +1,16 @@ import sys -from typing import List, Any, TypeVar, Union, Iterable, Iterator, TypeVar, Generic, Type, Sized +from typing import List, Any, TypeVar, Union, Iterable, Iterator, TypeVar, Generic, Type, Sized, Reversible, Container, Mapping _T = TypeVar('_T', bound=Enum) _S = TypeVar('_S', bound=Type[Enum]) -class EnumMeta(type, Iterable[Enum], Sized): +class EnumMeta(type, Iterable[Enum], Sized, Reversible[Enum], Container[Enum]): def __iter__(self: Type[_T]) -> Iterator[_T]: ... # type: ignore + def __reversed__(self: Type[_T]) -> Iterator[_T]: ... + def __contains__(self, member: Any) -> bool: ... + def __getitem__(self: Type[_T], name: str) -> _T: ... + @property + def __members__(self: Type[_T]) -> Mapping[str, _T]: ... class Enum(metaclass=EnumMeta): def __new__(cls: Type[_T], value: Any) -> _T: ...