Skip to main content

BuildSet

This trait defines the interface for constructing and managing a set-like collection of Python objects. It provides methods for adding items to the set and retrieving the current count of elements within the collection.

Methods


build_add()

def build_add(
item: Py< PyAny >
) - > PyResult< () >

Adds a Python object to the build set collection.

Parameters

NameTypeDescription
itemPy< PyAny >The Python object to be inserted into the set

Returns

TypeDescription
PyResult< () >A result indicating success or a Python exception if the addition fails

build_len()

def build_len() - > usize

Returns the total number of items currently contained within the build set.

Returns

TypeDescription
usizeThe count of elements in the set