Typed Python: Choose Sequence over List
Typed Python: Choose Sequence over List
blog.meadsteve.dev Typed Python: Choose Sequence over List
Why I would default to choosing sequence over list when adding types to a function
A blog post on choosing more specific types rather than general ones like list and dict.
You're viewing a single thread.
View all comments
8
comments
If you don't need to reuse the collection or access its items out of order, you can also use
Iterable
which accepts even more inputs like generators.8 0 Reply
You've viewed 8 comments.
Scroll to top