type vars/base.py
This commit is contained in:
parent
7a986695c5
commit
598a500c7c
@ -1550,7 +1550,7 @@ def figure_out_type(value: Any) -> types.GenericType:
|
|||||||
class cached_property_no_lock(functools.cached_property):
|
class cached_property_no_lock(functools.cached_property):
|
||||||
"""A special version of functools.cached_property that does not use a lock."""
|
"""A special version of functools.cached_property that does not use a lock."""
|
||||||
|
|
||||||
def __init__(self, func):
|
def __init__(self, func: Callable):
|
||||||
"""Initialize the cached_property_no_lock.
|
"""Initialize the cached_property_no_lock.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -2905,41 +2905,41 @@ class Field(Generic[T]):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(self: Field[bool], instance: None, owner) -> BooleanVar: ...
|
def __get__(self: Field[bool], instance: None, owner: Any) -> BooleanVar: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(self: Field[int], instance: None, owner) -> NumberVar: ...
|
def __get__(self: Field[int], instance: None, owner: Any) -> NumberVar: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(self: Field[str], instance: None, owner) -> StringVar: ...
|
def __get__(self: Field[str], instance: None, owner: Any) -> StringVar: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(self: Field[None], instance: None, owner) -> NoneVar: ...
|
def __get__(self: Field[None], instance: None, owner: Any) -> NoneVar: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(
|
def __get__(
|
||||||
self: Field[List[V]] | Field[Set[V]] | Field[Tuple[V, ...]],
|
self: Field[List[V]] | Field[Set[V]] | Field[Tuple[V, ...]],
|
||||||
instance: None,
|
instance: None,
|
||||||
owner,
|
owner: Any,
|
||||||
) -> ArrayVar[List[V]]: ...
|
) -> ArrayVar[List[V]]: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(
|
def __get__(
|
||||||
self: Field[Dict[str, V]], instance: None, owner
|
self: Field[Dict[str, V]], instance: None, owner: Any
|
||||||
) -> ObjectVar[Dict[str, V]]: ...
|
) -> ObjectVar[Dict[str, V]]: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(
|
def __get__(
|
||||||
self: Field[BASE_TYPE], instance: None, owner
|
self: Field[BASE_TYPE], instance: None, owner: Any
|
||||||
) -> ObjectVar[BASE_TYPE]: ...
|
) -> ObjectVar[BASE_TYPE]: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(self, instance: None, owner) -> Var[T]: ...
|
def __get__(self, instance: None, owner: Any) -> Var[T]: ...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def __get__(self, instance, owner) -> T: ...
|
def __get__(self, instance: Any, owner: Any) -> T: ...
|
||||||
|
|
||||||
def __get__(self, instance, owner): # type: ignore
|
def __get__(self, instance: Any, owner: Any): # type: ignore
|
||||||
"""Get the Var.
|
"""Get the Var.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
Loading…
Reference in New Issue
Block a user