-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move DataclassInstance to dataclasses.pyi
- Loading branch information
Showing
3 changed files
with
9 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
from dataclasses import Field | ||
from typing import Any, ClassVar, Protocol, TypeVar, Iterable | ||
from typing import Protocol, TypeVar, Iterable | ||
|
||
_KT = TypeVar("_KT") | ||
_VT_co = TypeVar("_VT_co", covariant=True) | ||
|
||
class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]): | ||
def keys(self) -> Iterable[_KT]: pass | ||
def __getitem__(self, __key: _KT) -> _VT_co: pass | ||
|
||
class DataclassInstance(Protocol): | ||
__dataclass_fields__: ClassVar[dict[str, Field[Any]]] |
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