Re: [Python-Dev] binary trees.

2006-05-11 Thread Vladimir 'Yu' Stepanov
Josiah Carlson wrote: > And you can actually compare str and unicode, so, if you have a str that > is greater than the unicode, you run into this issue. With unicode > becoming str in Py3k, we may not run into this issue much then, unless > bytes are comparable to str, in which case we end up with

Re: [Python-Dev] binary trees.

2006-05-06 Thread Tim Peters
[Josiah Carlson] > ... > >>> str < tuple < unicode > True > > And you can actually compare str and unicode, so, if you have a str that > is greater than the unicode, you run into this issue. Oh dear -- I didn't realize we still had holes like that: >>> 'b' < () < u'a' < 'b' True We used to have

Re: [Python-Dev] binary trees.

2006-05-06 Thread Josiah Carlson
"Vladimir 'Yu' Stepanov" <[EMAIL PROTECTED]> wrote: > Josiah Carlson wrote: > > This problem has nothing to do with dictionaries and hashing, it has to > > do with the fact that there may not be a total ordering on the elements > > of a sequence. > > It is sad. I did not know it. Therefore and ha

Re: [Python-Dev] binary trees.

2006-05-06 Thread Josiah Carlson
"Vladimir 'Yu' Stepanov" <[EMAIL PROTECTED]> wrote: > > Martin v. Löwis wrote: > > Vladimir 'Yu' Stepanov wrote: > > > >> Yes. I understood it when resulted a set example. > >> > >>> However, as I just said, people usually don't remove items from > >>> just-sorted lists, they tend to iter

Re: [Python-Dev] binary trees.

2006-05-06 Thread Vladimir 'Yu' Stepanov
Martin v. Löwis wrote: > Vladimir 'Yu' Stepanov wrote: > >> Yes. I understood it when resulted a set example. >> >>> However, as I just said, people usually don't remove items from >>> just-sorted lists, they tend to iterate over them via 'for i in list:' . >>> >>> >> Such problem

Re: [Python-Dev] binary trees.

2006-05-06 Thread Vladimir 'Yu' Stepanov
Josiah Carlson wrote: > "Vladimir 'Yu' Stepanov" <[EMAIL PROTECTED]> wrote: >> Josiah Carlson wrote: >>> However, as I just said, people usually don't remove items from >>> just-sorted lists, they tend to iterate over them via 'for i in list:' . >>> >> Such problem arises at creation of the list

Re: [Python-Dev] binary trees. Review obmalloc.c

2006-05-05 Thread Martin v. Löwis
Vladimir 'Yu' Stepanov wrote: > Yes. I understood it when resulted a set example. >> However, as I just said, people usually don't remove items from >> just-sorted lists, they tend to iterate over them via 'for i in list:' . >> > Such problem arises at creation of the list of timers. For a list

Re: [Python-Dev] binary trees. Review obmalloc.c

2006-05-05 Thread Josiah Carlson
"Vladimir 'Yu' Stepanov" <[EMAIL PROTECTED]> wrote: > Josiah Carlson wrote: > > However, as I just said, people usually don't remove items from > > just-sorted lists, they tend to iterate over them via 'for i in list:' . > > > Such problem arises at creation of the list of timers. I've never s

Re: [Python-Dev] binary trees. Review obmalloc.c

2006-05-05 Thread Vladimir 'Yu' Stepanov
Josiah Carlson wrote: "Vladimir 'Yu' Stepanov" <[EMAIL PROTECTED]> wrote: Comparison of functions of sorting and binary trees not absolutely correctly. I think that function sort will lose considerably on greater lists. Especially after an insert or removal of all one element. Genera

Re: [Python-Dev] binary trees. Review obmalloc.c

2006-05-04 Thread Vladimir 'Yu' Stepanov
Tim Peters wrote: [Vladimir 'Yu' Stepanov] * To adapt allocation of blocks of memory with other alignment. Now alignment is rigidly set on 8 bytes. As a variant, it is possible to use alignment on 4 bytes. And this value can be set at start of the interpreter through arguments/variable environme

Re: [Python-Dev] binary trees. Review obmalloc.c

2006-05-03 Thread Josiah Carlson
"Vladimir 'Yu' Stepanov" <[EMAIL PROTECTED]> wrote: > Comparison of functions of sorting and binary trees not absolutely > correctly. I think that function sort will lose considerably on > greater lists. Especially after an insert or removal of all one element. Generally speaking, people who un

Re: [Python-Dev] binary trees. Review obmalloc.c

2006-04-28 Thread Tim Peters
[Vladimir 'Yu' Stepanov] >> * To adapt allocation of blocks of memory with other alignment. Now >> alignment is rigidly set on 8 bytes. As a variant, it is possible to >> use alignment on 4 bytes. And this value can be set at start of the >> interpreter through arguments/variable environments/etc.

Re: [Python-Dev] binary trees. Review obmalloc.c

2006-04-28 Thread Martin v. Löwis
Vladimir 'Yu' Stepanov wrote: > * To adapt allocation of blocks of memory with other alignment. Now > alignment is rigidly set on 8 bytes. As a variant, it is possible to > use alignment on 4 bytes. And this value can be set at start of the > interpreter through arguments/variable environments/e

Re: [Python-Dev] binary trees. Review obmalloc.c

2006-04-27 Thread Vladimir 'Yu' Stepanov
Josiah Carlson wrote: > "Vladimir 'Yu' Stepanov" <[EMAIL PROTECTED]> wrote: > >> Josiah Carlson wrote: >> >>> There exists various C and Python implementations of both AVL and >>> Red-Black trees. For users of Python who want to use AVL and/or >>> Red-Black trees, I would urge them to use