Felyashono<p>I've finally got around to learning Python, and I'm currently working through some of the Advent Of Code '24 puzzles to get some hands on experience.</p><p>I appreciate some of what I think are Python's claims to fame. It's the first language in which I've worked with comprehensions. They're fun, but I'm not sure I see them as more than semi-arcane syntactic sugar for map() and filter(). Clearly, python's dynamic typing applied to list, tuple, comprehension, and generator is extremely powerful. Figuring out that I could just unpack all the elements from a short known-length list into a tuple has been handy.</p><p>The standard distro has modules for a great many things, and the package index has most everything else. On the other hand, how much is most? Maybe I'm missing something, but I can't find a module defining range_inclusive(start, stop) anywhere. Yes, I know it's trivial to write myself, but that seems at odds with Python's "batteries included" philosophy. All the research I've done seems to suggest the standard idiom is just to call range(start, stop + 1).</p><p>I love having access to a REPL again during code writing. It makes me miss the days of writing LISP in Emacs. I'm using PyCharm, which, of course, has the ability to load the current file directly into a new interpreter.</p><p>Probably my biggest gripe is that the language enforces so little and leaves so much to convention. Sure, it's higher-level than C, but it leaves you so many opportunities to shoot yourself in the foot at runtime. I had to laugh when reading up on classes, attributes, and scopes. Clearly, the moral was to define your data attributes inside the __init__ or you'll get some pretty bizarre bugs. </p><p><a href="https://autistics.life/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://autistics.life/tags/AdventOfCode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AdventOfCode</span></a></p>