[Python-Dev] xrange vs. int.__getslice__

2006-06-13 Thread Vladimir 'Yu' Stepanov
You were bothered yet with function xrange ? :) I suggest to replace it. - for i in xrange(100): pass vs. for i in int[:100]: pass - - for i

Re: [Python-Dev] xrange vs. int.__getslice__

2006-06-13 Thread Vladimir 'Yu' Stepanov
Thomas Wouters wrote: http://www.python.org/dev/peps/pep-0204/ (If you must really discuss this, which would probably be futile and senseless, please do it on python-3000 only.) Certainly looks very similar. PEP-204 demands change in a parser and considers a new design as replacement to

Re: [Python-Dev] total ordering.

2006-05-16 Thread Vladimir 'Yu' Stepanov
Guido van Rossum wrote: On 5/11/06, Vladimir 'Yu' Stepanov [EMAIL PROTECTED] wrote: If for Python-3000 similar it will be shown concerning types str(), int(), complex() and so on, and the type of exceptions will strongly vary, it will make problematic redefinition of behavior of function

Re: [Python-Dev] total ordering.

2006-05-11 Thread Vladimir 'Yu' Stepanov
Guido van Rossum wrote: On 5/6/06, Vladimir Yu. Stepanov [EMAIL PROTECTED] wrote: [proposing a total ordering between types] It Ain't Gonna Happen. (From now on, I'll write this as IAGH.) In Python 3000, we'll actually *remove* ordering between arbitrary types as a feature; only types

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 witht

Re: [Python-Dev] total ordering.

2006-05-07 Thread Vladimir Yu. Stepanov
On Sat, May 06, 2006 at 03:12:11AM -0700, Josiah Carlson wrote: 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

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 of timers

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 arises at creation

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. Generally

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

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 the Python

Re: [Python-Dev] Google Summer of Code proposal: New class for work with binary trees AVL and RB as with the standard dictionary.

2006-04-26 Thread Vladimir 'Yu' Stepanov
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 the Python implementations. In the case of *needing* the speed of a C extension, there already

Re: [Python-Dev] Google Summer of Code proposal: New class for work with binary trees AVL and RB as with the standard dictionary.

2006-04-26 Thread Vladimir 'Yu' Stepanov
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 the Python implementations. In the case of *needing* the speed of a C extension, there already

Re: [Python-Dev] Google Summer of Code proposal: New class for work with binary trees AVL and RB as with the standard dictionary.

2006-04-26 Thread Vladimir 'Yu' Stepanov
Hye-Shik Chang wrote: On 4/25/06, Vladimir 'Yu' Stepanov [EMAIL PROTECTED] wrote: Thanks for the answer, but after application of a patch on python-2.4.3 I could not compile it. A conclusion of a stage of compilation in the attached file. Aah. The patch is for Python

[Python-Dev] Google Summer of Code proposal: New class for work with binary trees AVL and RB as with the standard dictionary.

2006-04-24 Thread Vladimir 'Yu' Stepanov
I would like to participate in Google Summer of Code. The idea consists in creation of a specialized class for work with binary trees AVL and RB. The part of ideas is taken from Parrot (Perl6) where for pair values the specialized type is stipulated. As advantages it is possible to note: * High

[Python-Dev] Google Summer of Code proposal: New class for work with binary trees AVL and RB as with the standard dictionary.

2006-04-24 Thread Vladimir 'Yu' Stepanov
I would like to participate in Google Summer of Code. The idea consists in creation of a specialized class for work with binary trees AVL and RB. The part of ideas is taken from Parrot (Perl6) where for pair values the specialized type is stipulated. As advantages it is possible to note: * High