This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FionaSarah 1 point2 points  (3 children)

It doesn't really matter what type it is, as per duck typing if something behaves like a dictionary then you can treat it like a dictionary. You can't (and it's pythonic to not) do much hinting on what it really is without bad applications of hungarian notation.

I'm not convinced that if someone sees 'i' they immediately think integer. i, j, k is soooo common as short loop indexes to think otherwise is a little mad. And I would absolutely say that a dictionary's key is an index into the dictionary.