Tag view

#lists

Cross-subject tag search for related interview cards.

Clear

Results update as you type. Press / to jump straight into search.

Tagged with lists

4 cards

Python Medium Theory

Nested lists and list copy behavior

Nested lists make shallow copies especially important because the outer list may copy while inner lists still alias the same objects.

  • Nested structures magnify aliasing bugs
  • list() or slicing makes a shallow copy
  • deepcopy is for fully independent nested state

Nested lists and list copy behavior

React Easy Theory

Lists and keys in React

React uses keys to identify list items across renders so reconciliation can preserve identity correctly.

  • Keys must be stable and unique within the list
  • Indexes can break identity when order changes
  • Keys affect correctness as well as performance

Lists and keys in React