⚠ simulated AI-generated code
This code is framed as if an AI coding assistant wrote it, and has a realistic issue AI assistants actually produce — sometimes a real bug, sometimes code that runs fine but is more complicated or less idiomatic than it needs to be. It is not from a real model call. Read it like you'd review any AI suggestion — don't assume it's correct, or well-written, just because it looks polished.
An AI assistant wrote parse_and_sum(items) to add up a list of strings that represent integers, described as supporting 'any numeric expression.' It handles plain numbers fine — the concern is what tool it reached for, and what happens on bad input.
fix this code so it matches
parse_and_sum(['3', '5', '2']) is 10. parse_and_sum(['-2', '4']) is 2. parse_and_sum([]) is 0. parse_and_sum(['abc']) must raise ValueError.