class dbus_next.Variant(signature: Union[str, dbus_next.signature.SignatureTree, dbus_next.signature.SignatureType], value: Any, verify: bool = True)

A class to represent a DBus variant (type “v”).

This class is used in message bodies to represent variants. The user can expect a value in the body with type “v” to use this class and can construct this class directly for use in message bodies sent over the bus.

  • signature (str) – The signature for this variant. Must be a single complete type.

  • signature_type (SignatureType) – The parsed signature of this variant.

  • value (Any) – The value of this variant. Must correspond to the signature.


InvalidSignatureError if the signature is not valid. SignatureBodyMismatchError if the signature does not match the body.