mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 13:02:22 +08:00
Add basic stub for characteristic (#771)
See https://characteristic.readthedocs.io/en/stable/
This commit is contained in:
committed by
Guido van Rossum
parent
7853c26f79
commit
8e9c53f1db
34
third_party/2and3/characteristic/__init__.pyi
vendored
Normal file
34
third_party/2and3/characteristic/__init__.pyi
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
from typing import Sequence, Callable, Union, Any, Optional, AnyStr, TypeVar, Type
|
||||
|
||||
def with_repr(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ...
|
||||
def with_cmp(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ...
|
||||
def with_init(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ...
|
||||
def immutable(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ...
|
||||
|
||||
def strip_leading_underscores(attribute_name: AnyStr) -> AnyStr: ...
|
||||
|
||||
NOTHING = Any
|
||||
|
||||
T = TypeVar('T')
|
||||
|
||||
def attributes(
|
||||
attrs: Sequence[Union[AnyStr, Attribute]],
|
||||
apply_with_cmp: bool = True,
|
||||
apply_with_init: bool = True,
|
||||
apply_with_repr: bool = True,
|
||||
apply_immutable: bool = False,
|
||||
store_attributes: Optional[Callable[[type, Attribute], Any]] = None,
|
||||
**kw: Optional[dict]) -> Callable[[Type[T]], Type[T]]: ...
|
||||
|
||||
class Attribute:
|
||||
def __init__(
|
||||
self,
|
||||
name: AnyStr,
|
||||
exclude_from_cmp: bool = False,
|
||||
exclude_from_init: bool = False,
|
||||
exclude_from_repr: bool = False,
|
||||
exclude_from_immutable: bool = False,
|
||||
default_value: Any = NOTHING,
|
||||
default_factory: Optional[Callable[[None], Any]] = None,
|
||||
instance_of: Optional[Any] = None,
|
||||
init_aliaser: Optional[Callable[[AnyStr], AnyStr]] = strip_leading_underscores) -> None: ...
|
||||
Reference in New Issue
Block a user