[Python-ideas] Re: Change List Metadata

2020-01-15 Thread Kyle Stanley
> I meant by composing them in another class, which could then have > whatever interface makes sense for this data structure. Ah, I see. I had misunderstood you and thought you were advising the OP to combine list and Counter into their own new data structure, which seemed a bit overkill. That ma

[Python-ideas] Re: Change List Metadata

2020-01-15 Thread Eric V. Smith
On 1/15/2020 7:43 PM, Kyle Stanley wrote: > I suggest that when you need this functionality you create your own data > structure combining a list and a collections.Counter and keep track of > this yourself. I concur with the usage of collections.Counter here. Storing the count for every single

[Python-ideas] Re: Change List Metadata

2020-01-15 Thread Kyle Stanley
> I suggest that when you need this functionality you create your own data > structure combining a list and a collections.Counter and keep track of > this yourself. I concur with the usage of collections.Counter here. Storing the count for every single item in a list could end up being rather redu

[Python-ideas] Re: Change List Metadata

2020-01-15 Thread Eric V. Smith
On 1/14/2020 11:03 PM, Hunter Jones wrote: Hey everyone, I recently used list.count() in a coding interview and the question arose about how scale-able this solution was for sufficiently large input. Currently, list.count iterates through the list, incrementing the count as it goes and return

[Python-ideas] Re: Change List Metadata

2020-01-15 Thread C. Titus Brown
On Tue, Jan 14, 2020 at 10:03:24PM -0600, Hunter Jones wrote: > Hey everyone, > > I recently used list.count() in a coding interview and the question arose > about how scale-able this solution was for sufficiently large input. > Currently, list.count iterates through the list, incrementing the cou

[Python-ideas] Re: Change List Metadata

2020-01-15 Thread Paul Moore
On Wed, 15 Jan 2020 at 13:37, Hunter Jones wrote: > > Hey everyone, > > I recently used list.count() in a coding interview and the question arose > about how scale-able this solution was for sufficiently large input. > Currently, list.count iterates through the list, incrementing the count as it