8000 add missing kwargs from Enum functional api signature by anentropic · Pull Request #1710 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

add missing kwargs from Enum functional api signature #1710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasional 8000 ly send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion stdlib/3.4/enum.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import sys
from typing import List, Any, TypeVar, Union, Iterable, Iterator, TypeVar, Generic, Type, Sized, Reversible, Container, Mapping
from typing import List, Any, TypeVar, Union, Iterable, Iterator, Type, Sized, Reversible, Container, Mapping, Optional
from abc import ABCMeta

_T = TypeVar('_T', bound=Enum)
_T2 = TypeVar('_T2', bound=object)
_S = TypeVar('_S', bound=Type[Enum])

NamesType = Union[str, Iterable[Iterable[Any]], Mapping[str, Any]]

# Note: EnumMeta actually subclasses type directly, not ABCMeta.
# This is a temporary workaround to allow multiple creation of enums with builtins
# such as str as mixins, which due to the handling of ABCs of builtin types, cause
# spurious inconsistent metaclass structure. See #1595.
class EnumMeta(ABCMeta, Iterable[Enum], Sized, Reversible[Enum], Container[Enum]):
def __call__(cls, value: str, names: Optional[NamesType], module: Optional[str], qualname: Optional[str], type: Optional[Type[_T2]], start: int=1) -> Type[_T]: ...
def __iter__(self: Type[_T]) -> Iterator[_T]: ...
def __reversed__(self: Type[_T]) -> Iterator[_T]: ...
def __contains__(self, member: Any) -> bool: ...
Expand Down
0