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
![Typed Python: Choose Sequence over List](https://lemmy.world/pictrs/image/18858b02-4c9d-4f32-b8f8-16fd5da29979.png?format=webp&thumbnail=256)
A blog post on choosing more specific types rather than general ones like list and dict.
You're viewing a single thread.
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
8 comments
Scroll to top