Tuple Objects — Python 3.14.7 documentation

docs.python.org

Tin mới

Unicode Objects and Codecs

Python Module Index

3.14.7 Documentation

Python/C API reference manual

Concrete Objects Layer

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

Struct sequence objects are the C equivalent of namedtuple() objects, i.e. a sequence whose items can also be accessed through attributes. To create a struct sequence, you first have to create a specific struct sequence