3 ms·
I thought one of the advent of code challenges needed a linked list, but other than that, I have never needed one. I was just surprised as I thought it was a b
by wodenokoto 4y ago
I thought one of the advent of code challenges needed a linked list, but other than that, I have never needed one.
I was just surprised as I thought it was a basic structure, so it just seemed like there ought to be a `from collections import linkedlist` because python just feel like the kind of language where you just do that without even consulting the docs.
- maxbond 4y agoYeah for sure. I think your intuition is almost right. Python does have a "batteries included" philosophy, but it's also not usually clear or documented what data structures something is using. Like I presume that Python's sets are syntactic sugar over dictionaries where the values are None, but when I skimmed the docs just now I didn't find any mention of the implementation details. Python doesn't want you thinking in terms of data structures, just in terms of functionality. Which I think is unfortunate and limiting.