On Sat, Oct 02, 2021 at 07:57:48AM -0700, Guido van Rossum wrote: > No, it would also have to increment the reference count of each item (since > blist owns a reference to each). That's what makes this slow.
Ahaha, of course, I forgot about the ref counting. > > There are lots of other variants we could come up with, but ultimately > > we're doing lots of extra work that has to be thrown away, and that > > costs time or memory or both. > > That's always the case when you use Python though. You use it because it's > convenient, not because it's particularly efficient. Sure, but we do try to be no more inefficient than we need to be :-) > Are you actually observing that people are doing this with regular lists? See the Stackoverflow post I linked to at the start of my post. https://stackoverflow.com/questions/56966429/getting-pairs-of-one-item-and-the-rest-over-a-python-list I don't know if a gigabyte of data in a list is Big Data or not, but it's still pretty big. -- Steve _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/MC2SH34PJOFERLWYBWPRPT7VNCGY3UW7/ Code of Conduct: http://python.org/psf/codeofconduct/