The trap of modifying a list while iterating over it (and how to fix it). The library was warm, but Timothy was sweating. He was staring at a list of sensor data on his screen. "I don't understand," he muttered. "I told it to remove the errors. I wrote the code explicitly. But it keeps missing them." Margaret glided over, placing a fresh pot of tea on the table. "Missing them?" "Yes," Timothy said. "I have a list of temperature readings. Any reading below zero is an error—a glitch.
Aaron Rose
Verified
(He/Him)
Guy who talks about Toronto sports | 🇨🇦 born and raised | @mcgillu | @MedillSchool | Powered by @Ozoon_CA
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Aaron
Contact Aaron, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack