Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 777 Bytes

File metadata and controls

35 lines (24 loc) · 777 Bytes

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)
  • tup1 + tup2
  • tup * n, n * tup

Statements

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

Functions

  • len(tup: tuple)