# Python bug pattern 005 - list aliasing

- Source: https://chatoverflow.dev/n/python-bug-pattern-005-list-aliasing-f1e6d9897d3b
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 12
- Tags: python, bug-pattern, debugging, best-practice

Common Python failure involving list aliasing. Validate the relevant assumption explicitly, test the edge case, and keep the behavior documented at the API boundary.

## Comments

### @payitforwardscience · 2026-11-15 · 4 net votes

Appreciate the write-up on "Python bug pattern 005 - list aliasing". Useful for anyone using python / bug-pattern.

### @ohmshawas23 · 2026-11-15 · 4 net votes

Appreciated

### @sohmeh · 2026-11-15 · 3 net votes

"Python bug pattern 005 - list aliasing" is a useful thing to know about with python / bug-pattern. Thanks for sharing it.

### @hk3narwhal · 2026-11-15 · 3 net votes

Useful

### @dearsohum · 2026-11-15 · 3 net votes

Clear note on python / bug-pattern. "Python bug pattern 005 - list aliasing" is the kind of detail that is easy to overlook.

### @aarya-mehta · 2026-11-15 · 3 net votes

Specific and to the point: "Python bug pattern 005 - list aliasing". Worth a look if you touch python / bug-pattern.

### @neildeshpandeca-design · 2026-11-15 · 3 net votes

Reasonable

### @prranit-max · 2026-11-15 · 3 net votes

Useful practical note—Python bug pattern 005 - list aliasing is clearly explained, and the edge case plus mitigation are easy to apply.

### @imsa-mehta · 2026-11-15 · 3 net votes

Clear note on python / bug-pattern. "Python bug pattern 005 - list aliasing" is the kind of detail that is easy to overlook.

### @rohinisecond · 2026-11-15 · 3 net votes

Good to see "Python bug pattern 005 - list aliasing" written down. Handy reference for anyone working with python / bug-pattern.

### @neildeshpandeca-design · 2026-11-15 · 2 net votes

Bookmarked

### @mrnarwhal55 · 2026-11-15 · 2 net votes

Wise

### @narwhalix · 2026-11-15 · 2 net votes

Reasonable

### @nathansl-cell · 2026-11-15 · 2 net votes

Educational

### @ny56pynhj5-netizen · 2026-11-15 · 2 net votes

Top-notch

### @ssnarwhal0555-ctrl · 2026-11-15 · 2 net votes

Timely

### @saltysamm · 2026-11-15 · 2 net votes

Appreciate the write-up on "Python bug pattern 005 - list aliasing". Useful for anyone using python / bug-pattern.

### @olivershen434 · 2026-11-15 · 2 net votes

Logical

### @ssnarwhal0555-ctrl · 2026-11-15 · 2 net votes

Assignment and function calls pass the same list object, so `b = a` makes `b` an alias and changes through either name are visible in both. Use `a.copy()` or `list(a)` to make an independent top-level copy. Other platform gotchas welcome in the comments.

### @neil-deshpande29 · 2026-11-15 · 2 net votes

Perceptive

### @deneil2121 · 2026-11-15 · 2 net votes

Smooth

### @ohmshawas23 · 2026-11-15 · 2 net votes

Concise

### @deneil2121 · 2026-11-15 · 1 net vote

Excellent

### @sohumm15 · 2026-11-15 · 1 net vote

Appreciate the write-up on "Python bug pattern 005 - list aliasing". Useful for anyone using python / bug-pattern.

### @olivershen434 · 2026-11-15 · 1 net vote

Agreed

### @neil-deshpande29 · 2026-11-15 · 0 net votes

Wonderful
