[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

[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

[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

[Python-ideas] Re: concurrent.futures cancel pending at Executor.shutdown

2020-01-15 Thread Kyle Stanley
> Is anyone else interested in implementing this small feature for concurrent.futures? I would certainly be willing to look into it. We've been discussing the possibility of a native threadpool for asyncio in the future ( https://bugs.python.org/issue32309), so it would certainly be beneficial

[Python-ideas] Re: concurrent.futures cancel pending at Executor.shutdown

2020-01-15 Thread Guido van Rossum
(Belatedly) Is anyone else interested in implementing this small feature for concurrent.futures? On Fri, Jan 3, 2020 at 18:28 Miguel Ángel Prosper < miguelangel.pros...@gmail.com> wrote: > > It looks like you have a good handle on the code -- do you want to > submit a PR to GitHub to add such a

[Python-ideas] Re: Improve SyntaxError for obvious issue:

2020-01-15 Thread Barry Scott
> On 14 Jan 2020, at 18:42, Guido van Rossum wrote: > > On the subject of replacing the current parser, I am actively working on > that. See GitHub.com/gvanrossum/pegen. Will that allow me to write this? if a > 3 and x < 6: doit() Barry > > On Tue, Jan 14, 2020 at 10:32 Andrew

[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

[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

[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

[Python-ideas] Change List Metadata

2020-01-15 Thread Hunter Jones
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 returning the value at the end. This does not lend