About 52 results
Open links in new tab
  1. 5. Data Structures — Python 3.14.3 documentation

    4 days ago · It is not possible to assign to the individual items of a tuple, however it is possible to create tuples which contain mutable objects, such as lists. Though tuples may seem similar to lists, they are …

  2. 3. Data model — Python 3.14.3 documentation

    4 days ago · Tuples of two or more items are formed by comma-separated lists of expressions. A tuple of one item (a ‘singleton’) can be formed by affixing a comma to an expression (an expression by …

  3. Built-in Types — Python 3.9.24 documentation

    Tuple s are immutable sequences, typically used to store collections of heterogeneous data (such as the 2- tuple s produced by the enumerate() built-in). Tuple s are also used for cases where an immutable …

  4. Tuple Objects — Python 3.14.3 documentation

    4 days ago · As a struct sequence is modeled as a tuple, all fields are typed as PyObject*. The index in the fields array of the PyStructSequence_Desc determines which field of the struct sequence is …

  5. collections — Container datatypes — Python 3.14.3 documentation

    4 days ago · Named tuples assign meaning to each position in a tuple and allow for more readable, self-documenting code. They can be used wherever regular tuples are used, and they add the ability to …

  6. 6. Expressions — Python 3.14.3 documentation

    21 hours ago · Since tuples are immutable, the same rules as for literals apply (i.e., two occurrences of the empty tuple may or may not yield the same object). Note that tuples are not formed by the …

  7. 7. Simple statements — Python 3.14.3 documentation

    4 days ago · An assignment statement evaluates the expression list (remember that this can be a single expression or a comma-separated list, the latter yielding a tuple) and assigns the single resulting …

  8. Data Types — Python 3.14.3 documentation

    4 days ago · Python also provides some built-in data types, in particular, dict, list, set and frozenset, and tuple. The str class is used to hold Unicode strings, and the bytes and bytearray classes are used to …

  9. Design and History FAQ — Python 3.14.3 documentation

    4 days ago · If you want a dictionary indexed with a list, simply convert the list to a tuple first; the function tuple(L) creates a tuple with the same entries as the list L. Tuples are immutable and can …

  10. Functions creating iterators for efficient looping - Python

    4 days ago · The combination tuples are emitted in lexicographic order according to the order of the input iterable. If the input iterable is sorted, the output tuples will be produced in sorted order. …