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


Groups > comp.lang.python > #84030 > unrolled thread

Re: Trees

Started byMark Lawrence <breamoreboy@yahoo.co.uk>
First post2015-01-19 23:01 +0000
Last post2015-01-20 22:25 +0200
Articles 5 — 3 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Trees Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-19 23:01 +0000
    Re: Trees Marko Rauhamaa <marko@pacujo.net> - 2015-01-20 07:19 +0200
      Re: Trees Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-20 14:21 +0000
      Re: Trees Paul Rubin <no.email@nospam.invalid> - 2015-01-20 09:42 -0800
        Re: Trees Marko Rauhamaa <marko@pacujo.net> - 2015-01-20 22:25 +0200

#84030 — Re: Trees

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2015-01-19 23:01 +0000
SubjectRe: Trees
Message-ID<mailman.17865.1421708518.18130.python-list@python.org>
On 19/01/2015 22:06, Zachary Gilmartin wrote:
> Why aren't there trees in the python standard library?
>

Probably because you'd never get agreement as to which specific tree and 
which specific implementation was the most suitable for inclusion.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [next] | [standalone]


#84059

FromMarko Rauhamaa <marko@pacujo.net>
Date2015-01-20 07:19 +0200
Message-ID<87k30ihvvx.fsf@elektro.pacujo.net>
In reply to#84030
Mark Lawrence <breamoreboy@yahoo.co.uk>:

> On 19/01/2015 22:06, Zachary Gilmartin wrote:
>> Why aren't there trees in the python standard library?
>
> Probably because you'd never get agreement as to which specific tree
> and which specific implementation was the most suitable for inclusion.

Most programming languages provide one standard sorted mapping
implementation.

GvR is highly suspicious of the utility of trees and wouldn't like to
take the burden of maintaining them in the stdlib.

So in my Python software (both at work and at home) needs, I use a
Python AVL tree implementation of my own. My use case is timers. (GvR
uses heapq for the purpose.)


Marko

[toc] | [prev] | [next] | [standalone]


#84068

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2015-01-20 14:21 +0000
Message-ID<mailman.17891.1421763694.18130.python-list@python.org>
In reply to#84059
On 20/01/2015 05:19, Marko Rauhamaa wrote:
> Mark Lawrence <breamoreboy@yahoo.co.uk>:
>
>> On 19/01/2015 22:06, Zachary Gilmartin wrote:
>>> Why aren't there trees in the python standard library?
>>
>> Probably because you'd never get agreement as to which specific tree
>> and which specific implementation was the most suitable for inclusion.
>
> Most programming languages provide one standard sorted mapping
> implementation.
>

I'd have thought it would be the standard library and not the language 
that provided a sorted mapping.  Are you also saying that this has to be 
implemented as a tree, such that this has to be provided by cPython, 
Jython, IronPython, Pypy and so on and so forth?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#84076

FromPaul Rubin <no.email@nospam.invalid>
Date2015-01-20 09:42 -0800
Message-ID<87fvb5bb84.fsf@jester.gateway.sonic.net>
In reply to#84059
Marko Rauhamaa <marko@pacujo.net> writes:
> So in my Python software (both at work and at home) needs, I use a
> Python AVL tree implementation of my own. My use case is timers. (GvR
> uses heapq for the purpose.)

Have you benchmarked your version against heapq or even the builtin
sorting functions?

[toc] | [prev] | [next] | [standalone]


#84088

FromMarko Rauhamaa <marko@pacujo.net>
Date2015-01-20 22:25 +0200
Message-ID<87a91di4ht.fsf@elektro.pacujo.net>
In reply to#84076
Paul Rubin <no.email@nospam.invalid>:

> Marko Rauhamaa <marko@pacujo.net> writes:
>> So in my Python software (both at work and at home) needs, I use a
>> Python AVL tree implementation of my own. My use case is timers. (GvR
>> uses heapq for the purpose.)
>
> Have you benchmarked your version against heapq or even the builtin
> sorting functions?

Yes, I did (as I mentioned in an earlier posting). For the use case I
was interested in (timers in a busy server), heapq beefed with the
"garbage collection" trick came out about the same as my AVL tree
(native module).


Marko

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web