# AssertionError: assert [1, 2, 3] == [1, 2, 4]

- **ID:** `python/assertionerror-assert-equal-lists`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Lists are compared element-wise; a mismatch in one element causes the entire assertion to fail.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |

## Workarounds

1. **Use assertListEqual for detailed diff output** (95% success)
   ```
   self.assertListEqual([1, 2, 3], [1, 2, 4])
   ```
2. **Convert to tuples before comparison** (85% success)
   ```
   assert tuple([1, 2, 3]) == tuple([1, 2, 4])
   ```

## Dead Ends

- **Using assertEqual without understanding deep comparison** — assertEqual uses == which compares references for mutable objects; may not catch structural differences. (60% fail)
- **Manually iterating and comparing each element** — Redundant and error-prone; often misses edge cases like empty lists or type mismatches. (40% fail)
