forked from python/mypy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataclasses.pyi
More file actions
36 lines (25 loc) · 1.17 KB
/
dataclasses.pyi
File metadata and controls
36 lines (25 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from typing import Any, Callable, Generic, Mapping, Optional, TypeVar, overload, Type
_T = TypeVar('_T')
class InitVar(Generic[_T]):
...
class KW_ONLY: ...
@overload
def dataclass(_cls: Type[_T]) -> Type[_T]: ...
@overload
def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ...,
unsafe_hash: bool = ..., frozen: bool = ..., match_args: bool = ...,
kw_only: bool = ..., slots: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ...
@overload
def field(*, default: _T,
init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ...,
metadata: Optional[Mapping[str, Any]] = ..., kw_only: bool = ...,) -> _T: ...
@overload
def field(*, default_factory: Callable[[], _T],
init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ...,
metadata: Optional[Mapping[str, Any]] = ..., kw_only: bool = ...,) -> _T: ...
@overload
def field(*,
init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ...,
metadata: Optional[Mapping[str, Any]] = ..., kw_only: bool = ...,) -> Any: ...
class Field(Generic[_T]): pass
def replace(__obj: _T, **changes: Any) -> _T: ...