HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/mypyc/doc/tuple_operations.rst
.. _tuple-ops:

Native tuple operations
=======================

These ``tuple`` operations have fast, optimized implementations. Other
tuple operations use generic implementations that are often slower.

Unless mentioned otherwise, these operations apply to both fixed-length
tuples and variable-length tuples.

Construction
------------

* ``item0, ..., itemN`` (construct a tuple)
* ``tuple(lst: list)`` (construct a variable-length tuple)
* ``tuple(lst: Iterable)`` (construct a variable-length tuple)

Operators
---------

* ``tup[n]`` (integer index)
* ``tup[n:m]``, ``tup[n:]``, ``tup[:m]`` (slicing)

Statements
----------

* ``item0, ..., itemN = tup`` (for fixed-length tuples)

Functions
---------

* ``len(tup: tuple)``