Re: [Python-ideas] Add pop_callback to deque signature

2017-10-04 Thread Antoine Pitrou
On Wed, 4 Oct 2017 08:47:46 +0300 Serhiy Storchaka wrote: > 04.10.17 07:58, Nick Coghlan пише: > > For deque specifically, I like Steven D'Aprano's suggestion of a > > "__dropped__" or "__discard__" subclassing API that makes it > > straightforward to change the way that

Re: [Python-ideas] Add pop_callback to deque signature

2017-10-03 Thread Serhiy Storchaka
04.10.17 07:58, Nick Coghlan пише: For deque specifically, I like Steven D'Aprano's suggestion of a "__dropped__" or "__discard__" subclassing API that makes it straightforward to change the way that queue overruns are handled (especially if raising an exception from the new subclass method can

Re: [Python-ideas] Add pop_callback to deque signature

2017-10-03 Thread Nick Coghlan
On 4 October 2017 at 04:24, Chris Barker wrote: > [Antoine] >> The problem as >> I understand it is that you need a Windows machine (or VM) together with >> the required set of compilers, and have to take the time to run the >> builds. > > Yup — still the case. Also with

Re: [Python-ideas] Add pop_callback to deque signature

2017-10-03 Thread Chris Barker
> > > > that was some years ago -- I wonder how much use it's seen? > > You can go a surprisingly long way with Python's built-in and stdlib > containers, so I'm not surprised it's not very widely used. Exactly — what are the odds that list or deque performance is your bottleneck? However, the

Re: [Python-ideas] Add pop_callback to deque signature

2017-10-03 Thread Antoine Pitrou
On Tue, 3 Oct 2017 10:13:53 -0600 Chris Barker wrote: > On Tue, Oct 3, 2017 at 5:22 AM, Antoine Pitrou wrote: > > > Daniel Stutzbach's blist is well-known at this point: > > http://stutzbachenterprises.com/performance-blist > >

Re: [Python-ideas] Add pop_callback to deque signature

2017-10-03 Thread Chris Barker
On Tue, Oct 3, 2017 at 5:22 AM, Antoine Pitrou wrote: > Daniel Stutzbach's blist is well-known at this point: > http://stutzbachenterprises.com/performance-blist > >

Re: [Python-ideas] Add pop_callback to deque signature

2017-10-03 Thread Antoine Pitrou
On Tue, 3 Oct 2017 22:04:46 +1100 Steven D'Aprano wrote: > > If it were possible to have a lightweight sequence data structure with > fast O(1) random access AND insertion/deletion at the same time, that > would be a candidate to replace both lists and deques in the

Re: [Python-ideas] Add pop_callback to deque signature

2017-10-03 Thread Steven D'Aprano
On Tue, Oct 03, 2017 at 10:18:13AM +0200, Michel Desmoulin wrote: > My initial proposal would have been to add a data structure to allow > something like deque, but allowing cheaper random accesses. That would be a list :-) Most data structures trade off performance in one area for performance

[Python-ideas] Add pop_callback to deque signature

2017-10-03 Thread Michel Desmoulin
My initial proposal would have been to add a data structure to allow something like deque, but allowing cheaper random accesses. However I realized it was a use case more suitable for an external lib. Thinking about how I would implement such a new data structure, I imagined several