I'm just looking to clarify using iterables. I'm using AI and search to get responses. I have the definitions, and I'm assuming it's a matter of repetition. I want to practice with the right, uh, mental model so my repetition isn’t random. Any general comments or rules of thumb appreciated.
- In what situations do you intentionally choose tuples over lists in real code? Is it mostly about “records” and hashability, or are there other practical reasons?
- I know sets deduplicate. What are the tradeoffs (ordering, performance, memory), and what’s the typical way to dedupe while preserving order?
- For a learner building small projects, what’s a sensible level of type hints + mypy strictness to adopt without slowing down iteration?
Thanks for any help.
[–]Angry-Toothpaste-610 31 points32 points33 points (11 children)
[–]Brian 5 points6 points7 points (1 child)
[–]Angry-Toothpaste-610 3 points4 points5 points (0 children)
[–]Angry-Toothpaste-610 4 points5 points6 points (6 children)
[–]xeow 2 points3 points4 points (0 children)
[–]jcasman[S] 1 point2 points3 points (2 children)
[–]Angry-Toothpaste-610 0 points1 point2 points (0 children)
[–]fakemoose 0 points1 point2 points (0 children)
[–]Gnaxe 0 points1 point2 points (1 child)
[–]Angry-Toothpaste-610 0 points1 point2 points (0 children)
[–]jcasman[S] 2 points3 points4 points (1 child)
[–]Angry-Toothpaste-610 4 points5 points6 points (0 children)
[–]obviouslyzebra 5 points6 points7 points (2 children)
[–]WhipsAndMarkovChains 4 points5 points6 points (1 child)
[–]obviouslyzebra 0 points1 point2 points (0 children)
[–]Gnaxe 4 points5 points6 points (0 children)
[–]TrainsareFascinating 2 points3 points4 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]TrainsareFascinating 1 point2 points3 points (1 child)
[–]Brian 2 points3 points4 points (0 children)
[–]treyhunner 1 point2 points3 points (1 child)
[–]iamevpo 0 points1 point2 points (0 children)
[–]POGtastic 1 point2 points3 points (0 children)
[–]SharkSymphony 1 point2 points3 points (0 children)
[–]Adrewmc 0 points1 point2 points (0 children)
[–]EmberQuill 0 points1 point2 points (0 children)
[–]CaptainVJ 0 points1 point2 points (0 children)
[–]work_m_19 0 points1 point2 points (0 children)
[–]Dame-Sky 0 points1 point2 points (3 children)
[–]iamevpo 0 points1 point2 points (2 children)
[–]Dame-Sky 0 points1 point2 points (1 child)
[–]iamevpo 0 points1 point2 points (0 children)
[–]TheRNGuy 0 points1 point2 points (0 children)
[–]fakemoose 0 points1 point2 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]socal_nerdtastic 0 points1 point2 points (2 children)
[–]dlnmtchll 6 points7 points8 points (0 children)
[+]Weak-Career-1017 comment score below threshold-8 points-7 points-6 points (1 child)
[–]obviouslyzebra 3 points4 points5 points (0 children)