Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31672

Re: len() on mutables vs. immutables

Date 2012-10-18 11:38 -0700
From Demian Brecht <demianbrecht@gmail.com>
Subject Re: len() on mutables vs. immutables
References <50803B2C.6010900@gmail.com> <846C3A8E860C4344B567D813B63AA51D5A9C82FE@BL2PRD0610MB349.namprd06.prod.outlook.com>
Newsgroups comp.lang.python
Message-ID <mailman.2461.1350585508.27098.python-list@python.org> (permalink)

Show all headers | View raw


On 10/18/2012 11:28 AM, Nick Cash wrote:
> It appears that list has len() complexity of O(1)
> source: http://wiki.python.org/moin/TimeComplexity
> It may be worth mentioning that lists in Python are implemented using arrays instead of linked lists.
>
> It's reasonable to assume that other built-in collection types would be similar, though I don't see anything explicitly saying so for bytearray.
>
> -Nick Cash

Thanks for the link, I don't believe I had seen that one before.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: len() on mutables vs. immutables Demian Brecht <demianbrecht@gmail.com> - 2012-10-18 11:38 -0700

csiph-web