On Tue, Jun 30, 2020 at 8:55 PM David Lowry-Duda <david@lowryduda.com> wrote:
On the other hand, it seems far more likely to miss keys in a dictionary
than it is to repeatedly mistake indices in a list.

exactly -- dict keys are arbitrary, and it's pretty common to store "sparse" data by simply leaving out the key if there's nothing interesting attached to it.

But for Sequences, the only time you get an index error is if you are indexing beyond the length of the list, and the only case I can think of for get() would be for a maybe-empty list. otherwise, would I really want the same thing, and no error, for ANY index larger than the length of the list?

Rather, if there's a specific index we want, we want it to be there, and if not, then we are iterating over it, which handles any length (including zero) just fine.

-CHB



--
Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython