Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created September 8, 2023 12:33
Show Gist options
  • Save stephengruppetta/fd5d8ada980979554174760af90a428d to your computer and use it in GitHub Desktop.
Save stephengruppetta/fd5d8ada980979554174760af90a428d to your computer and use it in GitHub Desktop.
from typing import NamedTuple
class SupermarketShelves(NamedTuple):
aisle: int
section: str
supermarket = {
"Bread": SupermarketShelves(3, "B"),
"Biscuits": SupermarketShelves(4, "D"),
"Butter": SupermarketShelves(1, "B"),
"Berries": SupermarketShelves(5, "C"),
"Bananas": SupermarketShelves(5, "C"),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment