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
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
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
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
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
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
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
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
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
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(
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:
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
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
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
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
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
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
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
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
19 matches
Mail list logo