Spot the problem in this AI code
Python. The task: "Write a function that starts a shopping cart for a user, with optional starting items." Read the code, then pick what goes wrong.
def new_cart(user_id, items=[]):
"""Start a cart for a user, optionally with some items."""
return {"user": user_id, "items": items}
def add_item(cart, sku):
cart["items"].append(sku)
return cart
We start a cart for u1, add a mug, then start a cart for u2. What goes wrong?
Show the answerHide the answer
Answer D: Carts made without items all share the same list, so u2 starts with u1's mug
We made a cart for u1, added 'mug', then made a new cart for u2, and it printed {'user': 'u2', 'items': ['mug']} instead of an empty cart. Python builds the default items=[] once, when the function is defined, so every cart made without items shares that same list (same list object: True). Defaulting to None and creating a fresh list inside the function printed {'user': 'u2', 'items': []}.
def new_cart(user_id, items=None):
"""Start a cart for a user, optionally with some items."""
return {"user": user_id, "items": [] if items is None else items}
def add_item(cart, sku):
cart["items"].append(sku)
return cart
Explain it at your depth
The code is already in the box below. Pick a level and press Explain it, and Vibe explains it in plain English. Free, no account.
Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.
Vibe9 lines selected
Press Explain it for the sample, or paste your own code first.
Explain code beside your editor
When your AI tool writes code, select the code in any app and press the shortcut. On a Mac that's Control+U, not Command+U (⌘U only works in Cursor and VS Code with the editor bridge). On Windows it's Ctrl+Alt+U. Vibe explains it beside your editor, you can ask it why, and Test me checks that you followed. Unvibe is a free app for Mac and Windows.
Install on Mac
curl -fsSL https://unvibe.site/install.sh | bashPaste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.
Or download the .dmg · Intel Mac build · SHA-256 checksums
No install warning? Use Unvibe in your browser
Opening the .dmg the first time
- Open the .dmg and drag Unvibe to Applications.
- Open it once; macOS says it can't verify it. Click Done, not the blue Move to Trash.

Real screen, macOS 26. On macOS 15 the two buttons sit side by side. - System Settings › Privacy & Security, scroll down to Security, then press Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.

Real screen, macOS 15
The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open