ProxyBase
- class app.portfolio.collections.proxy.base.ProxyBase[source]
Bases:
Generic
Inheritance Diagram for ProxyBase
Methods
__init__
()get_instance_type
(cls[, source])Resolve and cache the concrete parent argument defined by the descriptor.
get_item_type
(cls[, source])Resolve and cache the concrete parent argument defined by the descriptor.
get_proxy_type
(cls[, source])Resolve and cache the concrete parent argument defined by the descriptor.
- __init__(*, instance: T_Instance, weakref: bool = True, allow_any: bool = False, source: type | GenericAlias | None = None) None [source]
- __init__(*, instance: object, field: str, weakref: bool = True, allow_any: bool = False, source: type | GenericAlias | None = None) None
- classmethod get_instance_type(cls: type[T], source: type[T] | None = None, **kwargs: Unpack[GetConcreteParentArgumentKwargs]) type[R]
Resolve and cache the concrete parent argument defined by the descriptor.
The descriptor caches the result per owning class via
instance_lru_cache()
so repeated introspections remain constant time.- Raises:
GenericsError – If the underlying parent argument cannot be resolved to a concrete type.
- Parameters:
cls (type[T])
source (type[T] | None)
kwargs (Unpack[GetConcreteParentArgumentKwargs])
- Return type:
type[R]
- classmethod get_item_type(cls: type[T], source: type[T] | None = None, **kwargs: Unpack[GetConcreteParentArgumentKwargs]) type[R]
Resolve and cache the concrete parent argument defined by the descriptor.
The descriptor caches the result per owning class via
instance_lru_cache()
so repeated introspections remain constant time.- Raises:
GenericsError – If the underlying parent argument cannot be resolved to a concrete type.
- Parameters:
cls (type[T])
source (type[T] | None)
kwargs (Unpack[GetConcreteParentArgumentKwargs])
- Return type:
type[R]
- classmethod get_proxy_type(cls: type[T], source: type[T] | None = None, **kwargs: Unpack[GetConcreteParentArgumentKwargs]) type[R]
Resolve and cache the concrete parent argument defined by the descriptor.
The descriptor caches the result per owning class via
instance_lru_cache()
so repeated introspections remain constant time.- Raises:
GenericsError – If the underlying parent argument cannot be resolved to a concrete type.
- Parameters:
cls (type[T])
source (type[T] | None)
kwargs (Unpack[GetConcreteParentArgumentKwargs])
- Return type:
type[R]