-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧹 Another refactoring of layout logic
- Loading branch information
1 parent
47568c2
commit 0f605ed
Showing
26 changed files
with
864 additions
and
755 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
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,15 +1,20 @@ | ||
"Compatibility layer for various Python versions" | ||
from __future__ import annotations | ||
|
||
import sys | ||
from itertools import tee | ||
from typing import Iterable, Iterator, TypeVar | ||
from typing import TYPE_CHECKING, Iterable, Iterator, TypeVar | ||
|
||
try: | ||
from itertools import pairwise | ||
except ImportError: | ||
__all__ = ["pairwise"] | ||
|
||
|
||
if sys.version_info < (3, 10) or TYPE_CHECKING: | ||
T = TypeVar("T") | ||
|
||
def pairwise(i: Iterable[T]) -> Iterator[tuple[T, T]]: | ||
a, b = tee(i) | ||
next(b, None) | ||
return zip(a, b) | ||
|
||
else: | ||
from itertools import pairwise |
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
Oops, something went wrong.