Bug Fix

The Identity Trap

The Identity Trap

Bug Report

A function compares two lists with the same values using 'is' to check if they match. Even though both lists look identical, the check fails and triggers an unnecessary reset.

is vs ==IdentityComparison
Fix the Bug: The Identity Trap

The 'is' operator checks object IDENTITY (same memory location), not equality of values. Two separately created lists (or dicts) with identical contents are still different objects in memory, so 'is' returns False even when '==' would return True.

EditorPython · JSX
PreviewUpdates on Run Tests
Loading preview…
Tests
Should use '==' to compare current and defaults
Should NOT use 'is' for value comparison
Should keep the same function signature