Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Curious why both of you need linked lists in Python? Are you doing a lot of list insertion operations or something & allocations are bringing it to a crawl?

I'm quite tickled by the idea that you need a linked list because your allocator is spending too much time - traversing a linked list.



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.


Yeah 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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: