-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Fix environment variables documentation generation (#362)"
This reverts commit a61c4e4.
- Loading branch information
Showing
9 changed files
with
42 additions
and
318 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
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
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,27 +1,30 @@ | ||
"""Documentation generation.""" | ||
|
||
from collections.abc import Iterator | ||
from collections.abc import Generator | ||
from enum import Enum | ||
from typing import Any, Generic, TypeVar | ||
|
||
_T = TypeVar("_T") | ||
|
||
class IterableStrEnum(str, Enum): | ||
"""Polyfill that also introduces dict-like behavior | ||
|
||
Introduces constructors that return a ``Iterator`` object | ||
class SuperEnum(Generic[_T], Enum): | ||
"""Adds constructors that return all items in a ``Generator``. | ||
Introduces constructors that return a ``Generator`` object | ||
either containing all items, only their names or their values. | ||
""" | ||
|
||
@classmethod | ||
def items(cls) -> Iterator[tuple[str, str]]: | ||
def items(cls) -> Generator[tuple[_T, Any], None, None]: | ||
"""Return all item names and values in tuples.""" | ||
return ((e.name, e.value) for e in cls) | ||
|
||
@classmethod | ||
def keys(cls) -> Iterator[str]: | ||
def keys(cls) -> Generator[_T, None, None]: | ||
"""Return all item names.""" | ||
return (e.name for e in cls) | ||
|
||
@classmethod | ||
def values(cls) -> Iterator[str]: | ||
def values(cls) -> Generator[Any, None, None]: | ||
"""Return all item values.""" | ||
return (e.value for e in cls) |
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
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
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
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.