_algopy_testing.primitives.string

Module Contents

Classes

String

Represents a UTF-8 encoded string backed by Bytes, accessible via .bytes.

API

class String(value: str = '')

Bases: _algopy_testing.protocols.BytesBacked

Represents a UTF-8 encoded string backed by Bytes, accessible via .bytes.

Works with str literals instead of bytes literals. Due to lack of AVM support for unicode, indexing and length operations are not supported. Use .bytes.length for byte length.

Initialization

classmethod from_bytes(
value: _algopy_testing.primitives.bytes.Bytes | bytes,
) _algopy_testing.primitives.string.String

Construct an instance from the underlying bytes (no validation)

property bytes: _algopy_testing.primitives.bytes.Bytes

Get the underlying Bytes.