Tuple Objects — Python 3.16.0a0 documentation

docs.python.org

Tin mới

Unicode Objects and Codecs

Python Module Index

3.16.0a0 Documentation

Python/C API reference manual

Concrete Objects Layer

Safe to call from multiple threads with external synchronization only

Return the object at position pos in the tuple pointed to by p. If pos is negative or out of bounds, return NULL and set an IndexError exception.

Py_NewRef(PyTuple_GetItem(...))

Return the object at position pos in the tuple pointed to by p. If pos is negative or out of bounds, return NULL and set an IndexError exception.

PySequence_GetItem()

Return the object at position pos in the tuple pointed to by p. If pos is negative or out of bounds, return NULL and set an IndexError exception.

collections.namedtuple()

A struct sequence object is a named tuple, that is, a sequence whose items can also be accessed through attributes. It is similar to collections.namedtuple(), but provides a slightly different interface.