-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
"""Documentation generation.""" | ||
|
||
from collections.abc import Generator | ||
from collections.abc import Iterator | ||
from enum import Enum | ||
from typing import Any | ||
|
||
|
||
class StrEnum(str, Enum): | ||
class IterableStrEnum(str, Enum): | ||
"""Temporary replacement for StrEnum while we suppport python3.10""" | ||
|
||
@classmethod | ||
def items(cls) -> Generator[tuple[Any, str], None, None]: | ||
def items(cls) -> Iterator[tuple[str, str]]: | ||
"""Return all item names and values in tuples.""" | ||
return ((e.name, e.value) for e in cls) | ||
|
||
@classmethod | ||
def keys(cls) -> Generator[str, None, None]: | ||
def keys(cls) -> Iterator[str]: | ||
"""Return all item names.""" | ||
return (e.name for e in cls) | ||
|
||
@classmethod | ||
def values(cls) -> Generator[Any, None, None]: | ||
def values(cls) -> Iterator[str]: | ||
"""Return all item values.""" | ||
return (e.value for e in cls) |