Commentary

  • Using or to handle mutable default values in Python functions can create unexpected new objects when passed an empty list, breaking the link to the original. The standard if None check is more reliable and readable, ensuring the original list is modified correctly.