PySequenceIterable
This class provides a unified interface for iterating over various Python sequence and collection types, including lists, tuples, sets, and iterators. It acts as a wrapper that abstracts the specific underlying container type to facilitate generic sequence processing. This allows for consistent iteration behavior across different Python data structures within a Rust context.
Attributes
| Attribute | Type | Description |
|---|---|---|
| List | Bound< 'py, PyList > | A reference to a Python list object used for sequence iteration. |
| Tuple | Bound< 'py, PyTuple > | A reference to a Python tuple object used for sequence iteration. |
| Set | Bound< 'py, PySet > | A reference to a Python set object used for sequence iteration. |
| FrozenSet | Bound< 'py, PyFrozenSet > | A reference to a Python frozenset object used for sequence iteration. |
| Iterator | Bound< 'py, PyIterator > | An owned Python iterator object used for sequence iteration. |
Constructor
Signature
def List(
list_ref: Bound< 'py, PyList >
) - > [PySequenceIterable](pysequenceiterable.md?sid=input_input_python_pysequenceiterable)
Parameters
| Name | Type | Description |
|---|---|---|
| list_ref | Bound< 'py, PyList > | The bound reference to the Python list to be iterated over. |
Signature
def Tuple(
tuple_ref: Bound< 'py, PyTuple >
) - > [PySequenceIterable](pysequenceiterable.md?sid=input_input_python_pysequenceiterable)
Parameters
| Name | Type | Description |
|---|---|---|
| tuple_ref | Bound< 'py, PyTuple > | The bound reference to the Python tuple to be iterated over. |
Signature
def Set(
set_ref: Bound< 'py, PySet >
) - > [PySequenceIterable](pysequenceiterable.md?sid=input_input_python_pysequenceiterable)
Parameters
| Name | Type | Description |
|---|---|---|
| set_ref | Bound< 'py, PySet > | The bound reference to the Python set to be iterated over. |
Signature
def FrozenSet(
frozenset_ref: Bound< 'py, PyFrozenSet >
) - > [PySequenceIterable](pysequenceiterable.md?sid=input_input_python_pysequenceiterable)
Parameters
| Name | Type | Description |
|---|---|---|
| frozenset_ref | Bound< 'py, PyFrozenSet > | The bound reference to the Python frozenset to be iterated over. |
Signature
def Iterator(
iterator_obj: Bound< 'py, PyIterator >
) - > [PySequenceIterable](pysequenceiterable.md?sid=input_input_python_pysequenceiterable)
Parameters
| Name | Type | Description |
|---|---|---|
| iterator_obj | Bound< 'py, PyIterator > | The bound Python iterator object used to yield sequence elements. |