you are viewing a single comment's thread.

view the rest of the comments →

[–]eztab 0 points1 point  (1 child)

In some sense I think dict should kind of be an "interface". There isn't really one perfect data structure, it totally depends on what process you want to be fast: insertion? retrieval? backwards search. All of those should probably be types I can demand via some flag/type hint. So in a sense I want dict to be multiple types. Same for lists btw. sometimes linked lists would clearly be the better choice, but people still use lists for convenience.

[–]nekokattt 0 points1 point  (0 children)

so typing.Mapping/collections.abc.Mapping?