-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
7 changed files
with
99 additions
and
14 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Internally used types.""" | ||
|
||
# Source from https://github.com/python/typing/issues/256#issuecomment-1442633430 | ||
from collections.abc import Iterator, Sequence | ||
from typing import Any, Protocol, SupportsIndex, TypeVar, overload | ||
|
||
_T_co = TypeVar("_T_co", covariant=True) | ||
|
||
|
||
class SequenceNotStr(Protocol[_T_co]): | ||
"""Lists of strings which are not strings themselves.""" | ||
|
||
@overload | ||
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... | ||
@overload | ||
def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... | ||
def __contains__(self, value: object, /) -> bool: ... | ||
def __len__(self) -> int: ... | ||
def __iter__(self) -> Iterator[_T_co]: ... | ||
def index( # pylint: disable=C0116 | ||
self, value: Any, start: int = 0, stop: int = ..., / | ||
) -> int: ... | ||
def count(self, value: Any, /) -> int: ... # pylint: disable=C0116 | ||
|
||
def __reversed__(self) -> Iterator[_T_co]: ... |
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