Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions sim_base_sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Scenario B feature work — should appear in the PR diff."""


def compute_total(items):
"""Sum item prices; intentional issue: shadows builtin 'sum'."""
sum = 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local `sum` variable shadows builtin function, causing bugs


The local assignment to sum shadows the builtin Python function sum(), making it unusable in the current scope. This can cause confusing bugs or runtime errors if the actual function is needed for summation or iterable processing.
Rename the local variable from sum to a non-builtin name to restore access to the builtin sum() function and prevent name conflicts.

for item in items:
sum += item
return sum
Loading