On this page
article
Snippet: Namedtuple
Copy-paste snippet for namedtuple.
Snippet
# namedtuple — snippet #15
# Adapt imports and variable names to your project
def example_15():
"""Demonstrates namedtuple pattern."""
pass # replace with implementation
Use When
You need a quick starting point for namedtuple without writing boilerplate from scratch.