mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-22 01:28:29 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
from typing import Any, AnyStr, Callable, Dict, Optional, Sequence, Type, TypeVar, Union
|
||||
from typing import Any, AnyStr, Callable, Dict, Sequence, Type, TypeVar
|
||||
|
||||
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 with_repr(attrs: Sequence[AnyStr | Attribute]) -> Callable[..., Any]: ...
|
||||
def with_cmp(attrs: Sequence[AnyStr | Attribute]) -> Callable[..., Any]: ...
|
||||
def with_init(attrs: Sequence[AnyStr | Attribute]) -> Callable[..., Any]: ...
|
||||
def immutable(attrs: Sequence[AnyStr | Attribute]) -> Callable[..., Any]: ...
|
||||
def strip_leading_underscores(attribute_name: AnyStr) -> AnyStr: ...
|
||||
|
||||
NOTHING = Any
|
||||
@@ -11,13 +11,13 @@ NOTHING = Any
|
||||
_T = TypeVar("_T")
|
||||
|
||||
def attributes(
|
||||
attrs: Sequence[Union[AnyStr, Attribute]],
|
||||
attrs: Sequence[AnyStr | Attribute],
|
||||
apply_with_cmp: bool = ...,
|
||||
apply_with_init: bool = ...,
|
||||
apply_with_repr: bool = ...,
|
||||
apply_immutable: bool = ...,
|
||||
store_attributes: Optional[Callable[[type, Attribute], Any]] = ...,
|
||||
**kw: Optional[Dict[Any, Any]],
|
||||
store_attributes: Callable[[type, Attribute], Any] | None = ...,
|
||||
**kw: Dict[Any, Any] | None,
|
||||
) -> Callable[[Type[_T]], Type[_T]]: ...
|
||||
|
||||
class Attribute:
|
||||
@@ -29,7 +29,7 @@ class Attribute:
|
||||
exclude_from_repr: bool = ...,
|
||||
exclude_from_immutable: bool = ...,
|
||||
default_value: Any = ...,
|
||||
default_factory: Optional[Callable[[None], Any]] = ...,
|
||||
instance_of: Optional[Any] = ...,
|
||||
init_aliaser: Optional[Callable[[AnyStr], AnyStr]] = ...,
|
||||
default_factory: Callable[[None], Any] | None = ...,
|
||||
instance_of: Any | None = ...,
|
||||
init_aliaser: Callable[[AnyStr], AnyStr] | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user