bayesline.api.equity.AnyConstraint

Contents

bayesline.api.equity.AnyConstraint#

bayesline.api.equity.AnyConstraint#

Runtime representation of an annotated type.

At its core ‘Annotated[t, dec1, dec2, …]’ is an alias for the type ‘t’ with extra annotations. The alias behaves like a normal typing alias. Instantiating is the same as instantiating the underlying type; binding it to types is also the same.

The metadata itself is stored in a ‘__metadata__’ attribute as a tuple.

alias of Annotated[FactorExposureConstraint | PositionBoundConstraint | PositionPinConstraint | MaxPositionSizeConstraint | NetExposureConstraint | GrossExposureConstraint | TurnoverConstraint | DoNotTradeConstraint | GroupNetExposureConstraint, Discriminator(discriminator=kind, custom_error_type=None, custom_error_message=None, custom_error_context=None)]