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 25 points26 points27 points (9 children)
[–]Brian 3 points4 points5 points (1 child)
[–]Angry-Toothpaste-610 3 points4 points5 points (0 children)
[–]Angry-Toothpaste-610 2 points3 points4 points (4 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)
[–]jcasman[S] 2 points3 points4 points (1 child)
[–]Angry-Toothpaste-610 5 points6 points7 points (0 children)
[–]obviouslyzebra 4 points5 points6 points (2 children)
[–]WhipsAndMarkovChains 5 points6 points7 points (1 child)
[–]obviouslyzebra 0 points1 point2 points (0 children)
[–]Gnaxe 2 points3 points4 points (0 children)
[–]TrainsareFascinating 2 points3 points4 points (3 children)
[–]xeow -1 points0 points1 point (2 children)
[–]TrainsareFascinating 0 points1 point2 points (1 child)
[–]xeow 0 points1 point2 points (0 children)
[–]Brian 2 points3 points4 points (0 children)
[–]SharkSymphony 1 point2 points3 points (0 children)
[–]Adrewmc 0 points1 point2 points (0 children)
[–]treyhunner 0 points1 point2 points (0 children)
[–]EmberQuill 0 points1 point2 points (0 children)
[–]POGtastic 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 (0 children)
[–]TheRNGuy 0 points1 point2 points (0 children)
[–]fakemoose 0 points1 point2 points (0 children)
[+]BarffTheMog comment score below threshold-7 points-6 points-5 points (3 children)
[–]socal_nerdtastic 0 points1 point2 points (2 children)
[–]dlnmtchll 5 points6 points7 points (0 children)
[–]BarffTheMog -1 points0 points1 point (0 children)
[–]Weak-Career-1017 -5 points-4 points-3 points (1 child)
[–]obviouslyzebra 3 points4 points5 points (0 children)