Re: [Python-3000] Thoughts on collections.Container and collections.Iterable

2008-02-11 Thread Lisandro Dalcin
itertools.count() maybe ? Well not really infinite, it stops with OverflowError... But then (don't try this at home)... >>> 4 in itertools.cycle(range(3)) # ups! I seems that implicitely supporting containment testing for any iterable is not always good idea. On 2/9/08, Neil Toronto <[EMAIL PRO

[Python-3000] about the status of PyNumberMethods

2008-05-09 Thread Lisandro Dalcin
Yesterday I was working on a patch for Cython to make the generated C code works from Python 2.3 to 2.6 and also 3.0. After four hours of carefully diving in Python sources from 2.3 to 3.0 and finishing the patch, the only stuff I would object from the current codebase of Py3K is the status of PyN

Re: [Python-3000] Single buffer implied in new buffer protocol?

2008-05-28 Thread Lisandro Dalcin
On 5/27/08, Greg Ewing <[EMAIL PROTECTED]> wrote: > Travis Oliphant wrote: > > > Obviously, if you haven't provided a Py_buffer structure to fill in, then > you are only asking to lock the object's buffer from other access. > > > > What's the use case for that? Why would you ever want > to lock a

Re: [Python-3000] [Python-Dev] Stabilizing the C API of 2.6 and 3.0

2008-06-02 Thread Lisandro Dalcin
Are you completelly sure of adding those guys: PyBytes_InternXXX ??? On 6/1/08, Gregory P. Smith <[EMAIL PROTECTED]> wrote: > On Fri, May 30, 2008 at 1:37 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > > On 2008-05-30 00:57, Nick Coghlan wrote: > >> > >> M.-A. Lemburg wrote: > >>> > >>> * W

Re: [Python-3000] [Python-Dev] Stabilizing the C API of 2.6 and 3.0

2008-06-02 Thread Lisandro Dalcin
problem here. Please note I'm definitely +1 for your patch, but the string interning API seems to need a bit more of care. Am I wrong? > > > On Mon, Jun 2, 2008 at 9:17 AM, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > > > Are you completelly sure

[Python-3000] MANIFEST.in -> MANIFEST

2008-06-11 Thread Lisandro Dalcin
Could someone give a try to Py3K distutils to see iff 'MANIFEST' is correctly generated from 'MANIFEST.in', specially in the case of having 'include' and 'recursive-include' sentences? -- Lisandro Dalcín --- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instit

[Python-3000] distutils: usage of the 'map()' builtin breaks the parsing of MANIFEST.in

2008-07-24 Thread Lisandro Dalcin
In module 'distutils.filelist', class 'FileList', method '_parse_template_line()', the 'map()' builtin is being used. Now 'map()' returns an iterator, and this iterator is exhausted in other methods (for the purpose of 'debug_print()' stuff) before the data is actually used. I'm currently monkey-p

Re: [Python-3000] [Python-Dev] Py3k: error during 'make install' in py3k-struni ?

2007-07-24 Thread Lisandro Dalcin
On 7/24/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I believe I rigged "make install" to continue after this error -- did > the rest of the install complete? Yes, it continued fine. BTW, are you interested in sending the output of python testsuite? I'm on a Fedora Core 6 box. I could build

Re: [Python-3000] interaction between locals, builtins and except clause

2007-07-26 Thread Lisandro Dalcin
On 7/26/07, Eduardo EdCrypt O. Padoan <[EMAIL PROTECTED]> > Python thinnks range is local, because you referenced it, even if an > error ocurred. Use 'global range' at the top of the file. Yes, I understand all that. I just wanted to know if the result of this locals + except + globals interaction

[Python-3000] interaction between locals, builtins and except clause

2007-07-26 Thread Lisandro Dalcin
Porting to Py3K, I modified a function like the followin, using a trick for it working in Py2.x . def __iter__(self): if self == _mpi.INFO_NULL: return try:range = xrange except: pass nkeys = _mpi.info_get_nkeys(self) for nthkey in range(

[Python-3000] docstring for dict.values

2007-07-27 Thread Lisandro Dalcin
Why the docstrings for 'dict.values' says "a set-like object ..." ?? >>> list(dict(a=1,b=1,c=1).values()) [1, 1, 1] -- Lisandro Dalcín ___ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe:

Re: [Python-3000] docstring for dict.values

2007-07-27 Thread Lisandro Dalcin
It seems the same applies to dict.items() ... $ set(dict(a=[]).items()) >>> set(dict(a=[]).items()) Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'list' On 7/27/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: &g

Re: [Python-3000] optimizing [x]range

2007-07-31 Thread Lisandro Dalcin
On 7/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Also, bringing it back more on-topic, what should the value of this > expression be? > 4 in range(0, 10, 3) > That is, are we treating range() as a set or an interval? IMHO, 'range' is a like a set of integers, not an interval. For me

Re: [Python-3000] optimizing [x]range

2007-07-31 Thread Lisandro Dalcin
On 7/31/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > You missed it -- it should definitely be equivalent to > 4 in list(range(0, 10, 3)) > i.e. > 4 in [0, 4, 8] An then, as list/tuple __contains__ is implemented in terms of rich comparison (with Py_EQ), perhaps a patch is not so easy

Re: [Python-3000] optimizing [x]range

2007-08-03 Thread Lisandro Dalcin
On 8/2/07, Stargaming <[EMAIL PROTECTED]> wrote: > >> made into an O(1) operation. here's a demo code (it should be trivial > >> to implement this in CPython) > [snipped algorithm] Did you taked into account that your patch is not backward compatible with py2.5?? Just try to do this with your patc

Re: [Python-3000] Py3k-buffer branch merged back to py3k branch

2007-08-21 Thread Lisandro Dalcin
Travis, I had no much time to follow you on py3k-buffer branch, but now you merged in py3k, I want to make an small comment for your consideration. Pehaps the 'PyBuffer' struct could be named different, something like 'Py_buffer'. The use case has some similarites to 'Py_complex' struct. It is no

[Python-3000] bug in py3k buffer object?

2007-08-31 Thread Lisandro Dalcin
Dear Travis, in my MPI wrappers, I use MPI_Alloc_mem function to get 'special' MPI memory, and next I return it to Python using return PyBuffer_FromReadWriteMemory(ptr, len); Well, getting back this rw-buffer in python, I tried to do mem = MPI.Alloc_mem(10) mem[:] = str8('\0') * 8 # sort of memz

Re: [Python-3000] [Python-Dev] building with -Wwrite-strings

2007-10-01 Thread Lisandro Dalcin
Yes, you are completely right. I ended up realizing that a change like this would break almost all third-party extension. But... What about of doing this for Py3K? Third-party extension have to be fixed anyway. On 10/1/07, Armin Rigo <[EMAIL PROTECTED]> wrote: > Hi Martin, > > On Fri, Sep 28, 20

Re: [Python-3000] Need help with menial tasks

2007-11-21 Thread Lisandro Dalcin
On 11/21/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I just changed PEP 3137 to rename the mutable bytes type 'bytearray' > instead of 'buffer', and implemented this change in the py3k branch. Have you ever consider using 'bytes' for the mutable and 'frozenbytes' for the inmutable? -- Lis