Seq
Bases:
Represent an in memory Sequence.
Implements the Sequence Protocol from collections.abc.
Provides a subset of Iter methods with eager evaluation, and is the return type of Iter.collect().
The underlying data structure is an immutable tuple, hence the memory efficiency is better than a Vec.
Tip
Seq(tuple) is preferred over Seq(list) as this is a no-copy operation (Python optimizes tuple creation from another tuple).
If you have an existing list, consider using Vec.from_ref() instead to avoid unnecessary copying.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
|
The data to initialize the Seq with. |
required |
Source code in src/pyochain/_iter.py
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | |