[pypy-commit] pypy no-failargs: Tweaks

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: no-failargs
Changeset: r58635:9a21fc7f0ca1
Date: 2012-10-30 14:49 +0100
http://bitbucket.org/pypy/pypy/changeset/9a21fc7f0ca1/

Log:Tweaks

diff --git a/pypy/jit/backend/llsupport/jitframe.py 
b/pypy/jit/backend/llsupport/jitframe.py
--- a/pypy/jit/backend/llsupport/jitframe.py
+++ b/pypy/jit/backend/llsupport/jitframe.py
@@ -12,6 +12,7 @@
 # For the front-end: a GCREF for the savedata
 ('jf_savedata', llmemory.GCREF),
 
-# XXX
+# All values are stored in the following array.
 ('jf_values', lltype.Array(llmemory.Address)))
+
 JITFRAMEPTR = lltype.Ptr(JITFRAME)
diff --git a/pypy/jit/metainterp/resoperation.py 
b/pypy/jit/metainterp/resoperation.py
--- a/pypy/jit/metainterp/resoperation.py
+++ b/pypy/jit/metainterp/resoperation.py
@@ -39,6 +39,8 @@
  NOT_RPYTHON this is for tests only!
 
 cls = opclasses[opnum]
+if 0 = cls.NUMARGS = 3:
+assert len(args) == cls.NUMARGS
 if cls.NUMARGS == 0:
 return create_resop_0(opnum, result, descr, mutable=mutable)
 elif cls.NUMARGS == 1:
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy no-failargs: Tentative (may be reverted): change FINISH to take 0 argument.

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: no-failargs
Changeset: r58636:d331eab8d5af
Date: 2012-10-31 09:58 +0100
http://bitbucket.org/pypy/pypy/changeset/d331eab8d5af/

Log:Tentative (may be reverted): change FINISH to take 0 argument.

diff --git a/pypy/jit/backend/llgraph/runner.py 
b/pypy/jit/backend/llgraph/runner.py
--- a/pypy/jit/backend/llgraph/runner.py
+++ b/pypy/jit/backend/llgraph/runner.py
@@ -260,7 +260,7 @@
 except ExecutionFinished, e:
 frame.finish_value = e.arg
 frame.latest_descr = e.descr
-frame._execution_finished_normally = e.descr.fast_path_done
+frame._fast_path_done = e.descr.fast_path_done
 return frame
 except GuardFailed, e:
 frame.latest_descr = e.descr
@@ -274,13 +274,6 @@
 def get_latest_descr(self, frame):
 return frame.latest_descr
 
-def get_finish_value_int(self, frame):
-res = frame.finish_value
-del frame.finish_value
-return res
-get_finish_value_float = get_finish_value_int
-get_finish_value_ref   = get_finish_value_int
-
 def grab_exc_value(self, frame):
 if frame.last_exception is not None:
 result = frame.last_exception.args[1]
@@ -484,7 +477,7 @@
 def bh_getinteriorfield_gc(self, a, index, descr):
 if isinstance(descr, JFValueDescr):
 assert isinstance(a, LLFrame)
-return a.latest_values[index]
+return a.framecontent[index]
 array = a._obj.container
 return support.cast_result(descr.FIELD,
   getattr(array.getitem(index), descr.fieldname))
@@ -623,7 +616,7 @@
 return isinstance(other, LLFrame) and self is other
 
 _forced = False
-_execution_finished_normally = False
+_fast_path_done = False
 finish_value = None
 
 def __init__(self, cpu, argboxes, args):
@@ -674,9 +667,9 @@
 args = [self.lookup(arg) for arg in op.getarglist()]
 self.current_op = op # for label
 self.current_index = i
+execute = getattr(self, 'execute_' + op.getopname())
 try:
-resval = getattr(self, 'execute_' + op.getopname())(
-_getdescr(op), *args)
+resval = execute(_getdescr(op), *args)
 except Jump, j:
 self.lltrace, i = j.descr._llgraph_target
 label_op = self.lltrace.operations[i]
@@ -876,32 +869,35 @@
 execute_call_release_gil_v = execute_call_release_gil
 
 def execute_call_assembler(self, descr, *args):
+# pframe = CALL_ASSEMBLER(args..., descr=looptoken)
+# ==
+# pframe = CALL looptoken.loopaddr(*args)
+# JUMP_IF_NOT_CARRY @forward
+# pframe = CALL assembler_call_helper(pframe)
+# @forward:
+#
+# CARRY is set before most returns, and cleared only
+# on FINISH with descr.fast_path_done.
+#
 call_op = self.lltrace.operations[self.current_index]
 guard_op = self.lltrace.operations[self.current_index + 1]
 assert guard_op.getopnum() == rop.GUARD_NOT_FORCED
 self.latest_descr = _getdescr(guard_op)
 #
-frame = self.cpu._execute_token(descr, *args)
-if frame._execution_finished_normally:# fast path
-result = frame.finish_value
-else:
+pframe = self.cpu._execute_token(descr, *args)
+if not pframe._fast_path_done:
 jd = descr.outermost_jitdriver_sd
 assembler_helper_ptr = jd.assembler_helper_adr.ptr  # fish
 try:
-result = assembler_helper_ptr(frame)
+result = assembler_helper_ptr(pframe)
 except LLException, lle:
 assert self.last_exception is None, exception left behind
 self.last_exception = lle
-if self.current_op.result is not None:
-return _example_res[self.current_op.result.type]
-return None
+return lltype.nullptr(llmemory.GCREF.TO)
+assert result is pframe
 #
 del self.latest_descr
-return support.cast_result(lltype.typeOf(result), result)
-execute_call_assembler_i = execute_call_assembler
-execute_call_assembler_r = execute_call_assembler
-execute_call_assembler_f = execute_call_assembler
-execute_call_assembler_v = execute_call_assembler
+return pframe
 
 def execute_same_as(self, _, x):
 return x
diff --git a/pypy/jit/backend/model.py b/pypy/jit/backend/model.py
--- a/pypy/jit/backend/model.py
+++ b/pypy/jit/backend/model.py
@@ -138,18 +138,10 @@
 Returns a GCREF.
 raise NotImplementedError
 
-def get_finish_value_int(self, jitframe):
-Return the result passed to FINISH, which was an int.
-raise NotImplementedError
-
-def get_finish_value_float(self, jitframe):
- 

[pypy-commit] pypy missing-ndarray-attributes: conjugate

2012-10-31 Thread fijal
Author: Maciej Fijalkowski fij...@gmail.com
Branch: missing-ndarray-attributes
Changeset: r58637:02887579c3d1
Date: 2012-10-29 15:46 +0100
http://bitbucket.org/pypy/pypy/changeset/02887579c3d1/

Log:conjugate

diff --git a/pypy/module/micronumpy/interp_numarray.py 
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -422,10 +422,6 @@
 loop.clip(space, self, shape, min, max, out)
 return out
 
-def descr_conj(self, space):
-raise OperationError(space.w_NotImplementedError, space.wrap(
-conj not implemented yet))
-
 def descr_ctypes(self, space):
 raise OperationError(space.w_NotImplementedError, space.wrap(
 ctypes not implemented yet))
@@ -467,10 +463,6 @@
 raise OperationError(space.w_NotImplementedError, space.wrap(
 getfield not implemented yet))
 
-def descr_imag(self, space):
-raise OperationError(space.w_NotImplementedError, space.wrap(
-imag not implemented yet))
-
 def descr_itemset(self, space, w_arg):
 raise OperationError(space.w_NotImplementedError, space.wrap(
 itemset not implemented yet))
@@ -488,10 +480,6 @@
 raise OperationError(space.w_NotImplementedError, space.wrap(
 put not implemented yet))
 
-def descr_real(self, space):
-raise OperationError(space.w_NotImplementedError, space.wrap(
-real not implemented yet))
-
 def descr_resize(self, space, w_new_shape, w_refcheck=True):
 raise OperationError(space.w_NotImplementedError, space.wrap(
 resize not implemented yet))
@@ -557,6 +545,8 @@
 descr_get_real = _unaryop_impl(real)
 descr_get_imag = _unaryop_impl(imag)
 
+descr_conj = _unaryop_impl('conjugate')
+
 def descr_nonzero(self, space):
 if self.get_size()  1:
 raise OperationError(space.w_ValueError, space.wrap(
@@ -804,6 +794,7 @@
 item = interp2app(W_NDimArray.descr_item),
 real = GetSetProperty(W_NDimArray.descr_get_real),
 imag = GetSetProperty(W_NDimArray.descr_get_imag),
+conj = interp2app(W_NDimArray.descr_conj),
 
 argsort  = interp2app(W_NDimArray.descr_argsort),
 astype   = interp2app(W_NDimArray.descr_astype),
diff --git a/pypy/module/micronumpy/test/test_complex.py 
b/pypy/module/micronumpy/test/test_complex.py
--- a/pypy/module/micronumpy/test/test_complex.py
+++ b/pypy/module/micronumpy/test/test_complex.py
@@ -552,6 +552,12 @@
 assert(real(c2) == 3.0)
 assert(imag(c2) == 4.0)
 
+def test_conj(self):
+from _numpypy import array
+
+a = array([1 + 2j, 1 - 2j])
+assert (a.conj() == [1 - 2j, 1 + 2j]).all()
+
 def test_math(self):
 if self.isWindows:
 skip('windows does not support c99 complex')
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: numpy has opinions. It has it's own opinion what's a sequence and it's own

2012-10-31 Thread fijal
Author: Maciej Fijalkowski fij...@gmail.com
Branch: 
Changeset: r58638:de6cd9aa69b0
Date: 2012-10-31 16:09 +0200
http://bitbucket.org/pypy/pypy/changeset/de6cd9aa69b0/

Log:numpy has opinions. It has it's own opinion what's a sequence and
it's own opinion what's an int. Deal with that

diff --git a/pypy/module/micronumpy/base.py b/pypy/module/micronumpy/base.py
--- a/pypy/module/micronumpy/base.py
+++ b/pypy/module/micronumpy/base.py
@@ -3,6 +3,11 @@
 from pypy.tool.pairtype import extendabletype
 from pypy.module.micronumpy.support import calc_strides
 
+def issequence_w(space, w_obj):
+return (space.isinstance_w(w_obj, space.w_tuple) or
+space.isinstance_w(w_obj, space.w_list) or
+isinstance(w_obj, W_NDimArray))
+
 class ArrayArgumentException(Exception):
 pass
 
@@ -44,7 +49,7 @@
 
 if isinstance(w_obj, W_NDimArray):
 return w_obj
-elif space.issequence_w(w_obj):
+elif issequence_w(space, w_obj):
 # Convert to array.
 return array(space, w_obj, w_order=None)
 else:
diff --git a/pypy/module/micronumpy/interp_numarray.py 
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -3,7 +3,7 @@
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
 from pypy.module.micronumpy.base import W_NDimArray, convert_to_array,\
- ArrayArgumentException
+ ArrayArgumentException, issequence_w
 from pypy.module.micronumpy import interp_dtype, interp_ufuncs, interp_boxes
 from pypy.module.micronumpy.strides import find_shape_and_elems,\
  get_shape_from_iterable, to_coords, shape_agreement
@@ -644,7 +644,7 @@
 @unwrap_spec(ndmin=int, copy=bool, subok=bool)
 def array(space, w_object, w_dtype=None, copy=True, w_order=None, subok=False,
   ndmin=0):
-if not space.issequence_w(w_object):
+if not issequence_w(space, w_object):
 if space.is_none(w_dtype):
 w_dtype = interp_ufuncs.find_dtype_for_scalar(space, w_object)
 dtype = space.interp_w(interp_dtype.W_Dtype,
diff --git a/pypy/module/micronumpy/test/test_numarray.py 
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -2272,6 +2272,11 @@
 raises(TypeError, a, 'sum')
 raises(TypeError, 'a+a')
 
+def test_string_scalar(self):
+from _numpypy import array
+a = array('')
+assert a.shape == ()
+
 def test_flexible_repr(self):
 # import overrides str(), repr() for array
 from numpypy.core import arrayprint
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: merge

2012-10-31 Thread fijal
Author: Maciej Fijalkowski fij...@gmail.com
Branch: 
Changeset: r58639:1fa8fb721755
Date: 2012-10-31 16:10 +0200
http://bitbucket.org/pypy/pypy/changeset/1fa8fb721755/

Log:merge

diff --git a/pypy/module/_cffi_backend/ctypeptr.py 
b/pypy/module/_cffi_backend/ctypeptr.py
--- a/pypy/module/_cffi_backend/ctypeptr.py
+++ b/pypy/module/_cffi_backend/ctypeptr.py
@@ -323,6 +323,7 @@
 
 
 rffi_fdopen = rffi.llexternal(fdopen, [rffi.INT, rffi.CCHARP], rffi.CCHARP)
+rffi_setbuf = rffi.llexternal(setbuf, [rffi.CCHARP,rffi.CCHARP], lltype.Void)
 rffi_fclose = rffi.llexternal(fclose, [rffi.CCHARP], rffi.INT)
 
 class CffiFileObj(object):
@@ -331,6 +332,7 @@
 self.llf = rffi_fdopen(fd, mode)
 if not self.llf:
 raise OSError(rposix.get_errno(), fdopen failed)
+rffi_setbuf(self.llf, lltype.nullptr(rffi.CCHARP.TO))
 def close(self):
 rffi_fclose(self.llf)
 
diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py 
b/pypy/module/_cffi_backend/test/_backend_test_c.py
--- a/pypy/module/_cffi_backend/test/_backend_test_c.py
+++ b/pypy/module/_cffi_backend/test/_backend_test_c.py
@@ -6,6 +6,7 @@
 mandatory_b_prefix = ''
 mandatory_u_prefix = 'u'
 bytechr = chr
+bitem2bchr = lambda x: x
 class U(object):
 def __add__(self, other):
 return eval('u'+repr(other).replace(r'\\u', r'\u')
@@ -19,6 +20,7 @@
 mandatory_b_prefix = 'b'
 mandatory_u_prefix = ''
 bytechr = lambda n: bytes([n])
+bitem2bchr = bytechr
 u = 
 
 def size_of_int():
@@ -1804,7 +1806,10 @@
 assert (p  s) ^ (p  s)
 
 def test_buffer():
-import __builtin__
+try:
+import __builtin__
+except ImportError:
+import builtins as __builtin__
 BShort = new_primitive_type(short)
 s = newp(new_pointer_type(BShort), 100)
 assert sizeof(s) == size_of_ptr()
@@ -1826,7 +1831,7 @@
 except IndexError:
 py.test.raises(IndexError, buf[i])
 else:
-assert buf[i] == expected
+assert buf[i] == bitem2bchr(expected)
 # --mb_slice--
 assert buf[:] == bhi there\x00
 for i in range(-12, 12):
@@ -1835,33 +1840,34 @@
 for j in range(-12, 12):
 assert buf[i:j] == bhi there\x00[i:j]
 # --misc--
-assert list(buf) == list(bhi there\x00)
+assert list(buf) == list(map(bitem2bchr, bhi there\x00))
 # --mb_as_buffer--
-py.test.raises(TypeError, __builtin__.buffer, c)
-bf1 = __builtin__.buffer(buf)
-assert len(bf1) == len(buf) and bf1[3] == t
+if hasattr(__builtin__, 'buffer'):  # Python = 2.7
+py.test.raises(TypeError, __builtin__.buffer, c)
+bf1 = __builtin__.buffer(buf)
+assert len(bf1) == len(buf) and bf1[3] == t
 if hasattr(__builtin__, 'memoryview'):  # Python = 2.7
 py.test.raises(TypeError, memoryview, c)
 mv1 = memoryview(buf)
-assert len(mv1) == len(buf) and mv1[3] == t
+assert len(mv1) == len(buf) and mv1[3] in (bt, ord(bt))
 # --mb_ass_item--
-expected = list(bhi there\x00)
+expected = list(map(bitem2bchr, bhi there\x00))
 for i in range(-12, 12):
 try:
-expected[i] = chr(i  0xff)
+expected[i] = bytechr(i  0xff)
 except IndexError:
-py.test.raises(IndexError, buf[i] = chr(i  0xff))
+py.test.raises(IndexError, buf[i] = bytechr(i  0xff))
 else:
-buf[i] = chr(i  0xff)
+buf[i] = bytechr(i  0xff)
 assert list(buf) == expected
 # --mb_ass_slice--
 buf[:] = bhi there\x00
-assert list(buf) == list(c) == list(bhi there\x00)
+assert list(buf) == list(c) == list(map(bitem2bchr, bhi there\x00))
 py.test.raises(ValueError, 'buf[:] = bshorter')
 py.test.raises(ValueError, 'buf[:] = bthis is much too long!')
 buf[4:2] = b   # no effect, but should work
 assert buf[:] == bhi there\x00
-expected = list(bhi there\x00)
+expected = list(map(bitem2bchr, bhi there\x00))
 x = 0
 for i in range(-12, 12):
 for j in range(-12, 12):
@@ -1869,10 +1875,10 @@
 stop  = j if j = 0 else j + len(buf)
 start = max(0, min(len(buf), start))
 stop  = max(0, min(len(buf), stop))
-sample = chr(x  0xff) * (stop - start)
+sample = bytechr(x  0xff) * (stop - start)
 x += 1
 buf[i:j] = sample
-expected[i:j] = sample
+expected[i:j] = map(bitem2bchr, sample)
 assert list(buf) == expected
 
 def test_getcname():
@@ -2245,6 +2251,11 @@
 assert len(p) == 4
 assert list(p) == [bf, bo, bo, b\x00]
 
+# XXX hack
+if sys.version_info = (3,):
+import posix, io
+posix.fdopen = io.open
+
 def test_FILE():
 if sys.platform == win32:
 py.test.skip(testing FILE not implemented)
@@ -2262,19 +2273,20 @@
 #
 import posix
 fdr, fdw = posix.pipe()
-fr1 = posix.fdopen(fdr, 'r', 

[pypy-commit] pypy default: Attempt a fix. Hard to test.

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58640:d9a653fb6785
Date: 2012-10-31 15:15 +0100
http://bitbucket.org/pypy/pypy/changeset/d9a653fb6785/

Log:Attempt a fix. Hard to test.

diff --git a/pypy/annotation/model.py b/pypy/annotation/model.py
--- a/pypy/annotation/model.py
+++ b/pypy/annotation/model.py
@@ -700,7 +700,7 @@
 return r
 
 def not_const(s_obj):
-if s_obj.is_constant():
+if s_obj.is_constant() and not isinstance(s_obj, SomePBC):
 new_s_obj = SomeObject.__new__(s_obj.__class__)
 dic = new_s_obj.__dict__ = s_obj.__dict__.copy()
 if 'const' in dic:
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: merge heads

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58641:ee9fe199c7cb
Date: 2012-10-31 15:23 +0100
http://bitbucket.org/pypy/pypy/changeset/ee9fe199c7cb/

Log:merge heads

diff --git a/pypy/module/micronumpy/base.py b/pypy/module/micronumpy/base.py
--- a/pypy/module/micronumpy/base.py
+++ b/pypy/module/micronumpy/base.py
@@ -3,6 +3,11 @@
 from pypy.tool.pairtype import extendabletype
 from pypy.module.micronumpy.support import calc_strides
 
+def issequence_w(space, w_obj):
+return (space.isinstance_w(w_obj, space.w_tuple) or
+space.isinstance_w(w_obj, space.w_list) or
+isinstance(w_obj, W_NDimArray))
+
 class ArrayArgumentException(Exception):
 pass
 
@@ -44,7 +49,7 @@
 
 if isinstance(w_obj, W_NDimArray):
 return w_obj
-elif space.issequence_w(w_obj):
+elif issequence_w(space, w_obj):
 # Convert to array.
 return array(space, w_obj, w_order=None)
 else:
diff --git a/pypy/module/micronumpy/interp_numarray.py 
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -3,7 +3,7 @@
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
 from pypy.module.micronumpy.base import W_NDimArray, convert_to_array,\
- ArrayArgumentException
+ ArrayArgumentException, issequence_w
 from pypy.module.micronumpy import interp_dtype, interp_ufuncs, interp_boxes
 from pypy.module.micronumpy.strides import find_shape_and_elems,\
  get_shape_from_iterable, to_coords, shape_agreement
@@ -644,7 +644,7 @@
 @unwrap_spec(ndmin=int, copy=bool, subok=bool)
 def array(space, w_object, w_dtype=None, copy=True, w_order=None, subok=False,
   ndmin=0):
-if not space.issequence_w(w_object):
+if not issequence_w(space, w_object):
 if space.is_none(w_dtype):
 w_dtype = interp_ufuncs.find_dtype_for_scalar(space, w_object)
 dtype = space.interp_w(interp_dtype.W_Dtype,
diff --git a/pypy/module/micronumpy/test/test_numarray.py 
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -2272,6 +2272,11 @@
 raises(TypeError, a, 'sum')
 raises(TypeError, 'a+a')
 
+def test_string_scalar(self):
+from _numpypy import array
+a = array('')
+assert a.shape == ()
+
 def test_flexible_repr(self):
 # import overrides str(), repr() for array
 from numpypy.core import arrayprint
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Add the '--opt=..' option to py.py, as a way to enable all pypy-specific

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58644:2d138f334c76
Date: 2012-10-31 17:06 +0100
http://bitbucket.org/pypy/pypy/changeset/2d138f334c76/

Log:Add the '--opt=..' option to py.py, as a way to enable all pypy-
specific options at a certain optimization level.

diff --git a/pypy/bin/py.py b/pypy/bin/py.py
--- a/pypy/bin/py.py
+++ b/pypy/bin/py.py
@@ -65,10 +65,17 @@
 config, parser = option.get_standard_options()
 interactiveconfig = Config(cmdline_optiondescr)
 to_optparse(interactiveconfig, parser=parser)
+def set_family_of_options(option, opt, value, parser):
+from pypy.config.pypyoption import set_pypy_opt_level
+set_pypy_opt_level(config, value)
 parser.add_option(
 '--cc', type=str, action=callback,
 callback=set_compiler,
 help=Compiler to use for compiling generated C)
+parser.add_option(
+'--opt', type=str, action=callback,
+callback=set_family_of_options,
+help=Set the family of options based on -opt=0,1,2,jit...)
 args = option.process_options(parser, argv[1:])
 if interactiveconfig.verbose:
 error.RECORD_INTERPLEVEL_TRACEBACK = True
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Add a sanity check.

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58645:1946e86bd7a5
Date: 2012-10-31 17:34 +0100
http://bitbucket.org/pypy/pypy/changeset/1946e86bd7a5/

Log:Add a sanity check.

diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -843,10 +843,14 @@
 isinstance(w_newtype, W_TypeObject) and
 not w_newtype.is_heaptype() and
 not space.is_w(w_newtype, space.w_type)):
-w_type.w_bltin_new = w_newfunc
+w_type.w_bltin_new = w_bltin_new = w_newfunc
 w_newobject = space.call_obj_args(w_newfunc, w_type, __args__)
 call_init = space.isinstance_w(w_newobject, w_type)
 
+# sanity check
+if not we_are_translated() and w_bltin_new is not None:
+assert space.isinstance_w(w_newobject, w_type)
+
 # maybe invoke the __init__ of the type
 if (call_init and not (space.is_w(w_type, space.w_type) and
 not __args__.keywords and len(__args__.arguments_w) == 1)):
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Simplify the logic.

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58646:fd45b4a00ced
Date: 2012-10-31 17:37 +0100
http://bitbucket.org/pypy/pypy/changeset/fd45b4a00ced/

Log:Simplify the logic.

diff --git a/pypy/interpreter/buffer.py b/pypy/interpreter/buffer.py
--- a/pypy/interpreter/buffer.py
+++ b/pypy/interpreter/buffer.py
@@ -64,7 +64,7 @@
 if not isinstance(self, RWBuffer):
 raise OperationError(space.w_TypeError,
  space.wrap(buffer is read-only))
-start, stop, step = space.decode_index(w_index, self.getlength())
+start, stop, step, size = space.decode_index4(w_index, 
self.getlength())
 if step == 0:  # index only
 if len(newstring) != 1:
 msg = 'buffer[index]=x: x must be a single character'
@@ -72,13 +72,9 @@
 char = newstring[0]   # annotator hint
 self.setitem(start, char)
 elif step == 1:
-length = stop - start
-if length != len(newstring):
-if length  0 and len(newstring) == 0:
-pass # ok anyway
-else:
-msg = right operand length must match slice length
-raise OperationError(space.w_ValueError, space.wrap(msg))
+if len(newstring) != size:
+msg = right operand length must match slice length
+raise OperationError(space.w_ValueError, space.wrap(msg))
 self.setslice(start, newstring)
 else:
 raise OperationError(space.w_ValueError,
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Hopefully, fixes for 'test_buffer' after O2 or Ojit translation.

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58647:e3a20a600eaf
Date: 2012-10-31 17:47 +0100
http://bitbucket.org/pypy/pypy/changeset/e3a20a600eaf/

Log:Hopefully, fixes for 'test_buffer' after O2 or Ojit translation.
Hard to test...

diff --git a/pypy/module/_cffi_backend/cbuffer.py 
b/pypy/module/_cffi_backend/cbuffer.py
--- a/pypy/module/_cffi_backend/cbuffer.py
+++ b/pypy/module/_cffi_backend/cbuffer.py
@@ -1,4 +1,5 @@
 from pypy.interpreter.error import operationerrfmt
+from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.buffer import RWBuffer
 from pypy.interpreter.gateway import unwrap_spec, interp2app
 from pypy.interpreter.typedef import TypeDef
@@ -35,15 +36,37 @@
 for i in range(len(string)):
 raw_cdata[i] = string[i]
 
-LLBuffer.typedef = TypeDef(
+
+class MiniBuffer(Wrappable):
+# a different subclass of Wrappable for the MiniBuffer, because we
+# want a slightly different (simplified) API at the level of Python.
+
+def __init__(self, buffer):
+self.buffer = buffer
+
+def descr_len(self, space):
+return self.buffer.descr_len(space)
+
+def descr_getitem(self, space, w_index):
+return self.buffer.descr_getitem(space, w_index)
+
+@unwrap_spec(newstring='bufferstr')
+def descr_setitem(self, space, w_index, newstring):
+self.buffer.descr_setitem(space, w_index, newstring)
+
+def descr__buffer__(self, space):
+return self.buffer.descr__buffer__(space)
+
+
+MiniBuffer.typedef = TypeDef(
 buffer,
 __module__ = _cffi_backend,
-__len__ = interp2app(RWBuffer.descr_len),
-__getitem__ = interp2app(RWBuffer.descr_getitem),
-__setitem__ = interp2app(RWBuffer.descr_setitem),
-__buffer__ = interp2app(RWBuffer.descr__buffer__),
+__len__ = interp2app(MiniBuffer.descr_len),
+__getitem__ = interp2app(MiniBuffer.descr_getitem),
+__setitem__ = interp2app(MiniBuffer.descr_setitem),
+__buffer__ = interp2app(MiniBuffer.descr__buffer__),
 )
-LLBuffer.typedef.acceptable_as_base_class = False
+MiniBuffer.typedef.acceptable_as_base_class = False
 
 
 @unwrap_spec(cdata=cdataobj.W_CData, size=int)
@@ -63,4 +86,4 @@
 raise operationerrfmt(space.w_TypeError,
   don't know the size pointed to by '%s',
   ctype.name)
-return space.wrap(LLBuffer(cdata._cdata, size))
+return space.wrap(MiniBuffer(LLBuffer(cdata._cdata, size)))
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy missing-ndarray-attributes: implement diagonal. I wonder if the jit would help here

2012-10-31 Thread fijal
Author: Maciej Fijalkowski fij...@gmail.com
Branch: missing-ndarray-attributes
Changeset: r58650:e28b7a70729c
Date: 2012-10-31 18:59 +0200
http://bitbucket.org/pypy/pypy/changeset/e28b7a70729c/

Log:implement diagonal. I wonder if the jit would help here

diff --git a/pypy/module/micronumpy/interp_arrayops.py 
b/pypy/module/micronumpy/interp_arrayops.py
--- a/pypy/module/micronumpy/interp_arrayops.py
+++ b/pypy/module/micronumpy/interp_arrayops.py
@@ -173,12 +173,24 @@
 
 def diagonal(space, arr, offset, axis1, axis2):
 shape = arr.get_shape()
+shapelen = len(shape)
+if offset  0:
+offset = -offset
+axis1, axis2 = axis2, axis1
 size = min(shape[axis1], shape[axis2] - offset)
 dtype = arr.dtype
-if len(shape) == 2:
+if axis1  axis2:
+shape = (shape[:axis1] + shape[axis1 + 1:axis2] +
+ shape[axis2 + 1:] + [size])
+else:
+shape = (shape[:axis2] + shape[axis2 + 1:axis1] +
+ shape[axis1 + 1:] + [size])
+out = W_NDimArray.from_shape(shape, dtype)
+if size == 0:
+return out
+if shapelen == 2:
 # simple case
-out = W_NDimArray.from_shape([size], dtype)
 loop.diagonal_simple(space, arr, out, offset, axis1, axis2, size)
-return out
 else:
-xxx
+loop.diagonal_array(space, arr, out, offset, axis1, axis2, shape)
+return out
diff --git a/pypy/module/micronumpy/interp_numarray.py 
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -439,6 +439,9 @@
 raise operationerrfmt(space.w_ValueError,
  axis1(=%d) and axis2(=%d) must be withing range (ndim=%d),
   axis1, axis2, len(self.get_shape()))
+if axis1 == axis2:
+raise OperationError(space.w_ValueError, space.wrap(
+axis1 and axis2 cannot be the same))
 return interp_arrayops.diagonal(space, self.implementation, offset,
 axis1, axis2)
 
diff --git a/pypy/module/micronumpy/loop.py b/pypy/module/micronumpy/loop.py
--- a/pypy/module/micronumpy/loop.py
+++ b/pypy/module/micronumpy/loop.py
@@ -9,7 +9,7 @@
 from pypy.rlib import jit
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.module.micronumpy.base import W_NDimArray
-from pypy.module.micronumpy.iter import PureShapeIterator
+from pypy.module.micronumpy.iter import PureShapeIterator, 
ConcreteArrayIterator
 from pypy.module.micronumpy import constants
 from pypy.module.micronumpy.support import int_w
 
@@ -598,3 +598,21 @@
 out_iter.setitem(arr.getitem_index(space, index))
 i += 1
 out_iter.next()
+
+def diagonal_array(space, arr, out, offset, axis1, axis2, shape):
+out_iter = out.create_iter()
+iter = PureShapeIterator(shape, [])
+shapelen = len(shape)
+while not iter.done():
+last_index = iter.indexes[-1]
+if axis1  axis2:
+indexes = (iter.indexes[:axis1] + [last_index] +
+   iter.indexes[axis1:axis2 - 1] + [last_index + offset] +
+   iter.indexes[axis2 - 1:shapelen - 1])
+else:
+indexes = (iter.indexes[:axis2] + [last_index + offset] +
+   iter.indexes[axis2:axis1 - 1] + [last_index] +
+   iter.indexes[axis1 - 1:shapelen - 1])
+out_iter.setitem(arr.getitem_index(space, indexes))
+iter.next()
+out_iter.next()
diff --git a/pypy/module/micronumpy/test/test_numarray.py 
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -2114,9 +2114,27 @@
 from _numpypy import array
 a = array([[1, 2], [3, 4], [5, 6]])
 raises(ValueError, 'array([1, 2]).diagonal()')
+raises(ValueError, 'a.diagonal(0, 0, 0)')
+raises(ValueError, 'a.diagonal(0, 0, 13)')
 assert (a.diagonal() == [1, 4]).all()
 assert (a.diagonal(1) == [2]).all()
 
+def test_diagonal_axis(self):
+from _numpypy import arange
+a = arange(12).reshape(2, 3, 2)
+assert (a.diagonal(0, 0, 1) == [[0, 8], [1, 9]]).all()
+assert a.diagonal(3, 0, 1).shape == (2, 0)
+assert (a.diagonal(1, 0, 1) == [[2, 10], [3, 11]]).all() 
+assert (a.diagonal(0, 2, 1) == [[0, 3], [6, 9]]).all()
+assert (a.diagonal(2, 2, 1) == [[4], [10]]).all()
+assert (a.diagonal(1, 2, 1) == [[2, 5], [8, 11]]).all()
+
+def test_diagonal_axis_neg_ofs(self):
+from _numpypy import arange
+a = arange(12).reshape(2, 3, 2)
+assert (a.diagonal(-1, 0, 1) == [[6], [7]]).all()
+assert a.diagonal(-2, 0, 1).shape == (2, 0)
+
 class AppTestSupport(BaseNumpyAppTest):
 def setup_class(cls):
 import struct

[pypy-commit] pypy unicode-strategies: fix test_stressdict

2012-10-31 Thread antocuni
Author: Antonio Cuni anto.c...@gmail.com
Branch: unicode-strategies
Changeset: r58651:f48a80508682
Date: 2012-10-31 17:58 +0100
http://bitbucket.org/pypy/pypy/changeset/f48a80508682/

Log:fix test_stressdict

diff --git a/pypy/objspace/std/test/test_dictmultiobject.py 
b/pypy/objspace/std/test/test_dictmultiobject.py
--- a/pypy/objspace/std/test/test_dictmultiobject.py
+++ b/pypy/objspace/std/test/test_dictmultiobject.py
@@ -859,7 +859,7 @@
 raises(RuntimeError, list, it)
 
 
-class FakeString(str):
+class FakeWrapper(object):
 hash_count = 0
 def unwrap(self, space):
 self.unwrapped = True
@@ -869,6 +869,12 @@
 self.hash_count += 1
 return str.__hash__(self)
 
+class FakeString(FakeWrapper, str):
+pass
+
+class FakeUnicode(FakeWrapper, unicode):
+pass
+
 # the minimal 'space' needed to use a W_DictMultiObject
 class FakeSpace:
 hash_count = 0
@@ -941,6 +947,7 @@
 w_bool = bool
 w_float = float
 StringObjectCls = FakeString
+UnicodeObjectCls = FakeUnicode
 w_dict = W_DictMultiObject
 iter = iter
 fixedview = list
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy unicode-strategies: implement listview_unicode for W_UnicodeObject

2012-10-31 Thread antocuni
Author: Antonio Cuni anto.c...@gmail.com
Branch: unicode-strategies
Changeset: r58652:09dfbb4ed8dd
Date: 2012-10-31 18:03 +0100
http://bitbucket.org/pypy/pypy/changeset/09dfbb4ed8dd/

Log:implement listview_unicode for W_UnicodeObject

diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -473,8 +473,8 @@
 return w_obj.listview_unicode()
 if type(w_obj) is W_SetObject or type(w_obj) is W_FrozensetObject:
 return w_obj.listview_unicode()
-## if isinstance(w_obj, W_UnicodeObject):
-## return w_obj.listview_unicode()
+if isinstance(w_obj, W_UnicodeObject):
+return w_obj.listview_unicode()
 if isinstance(w_obj, W_ListObject) and self._uses_list_iter(w_obj):
 return w_obj.getitems_unicode()
 return None
diff --git a/pypy/objspace/std/test/test_unicodeobject.py 
b/pypy/objspace/std/test/test_unicodeobject.py
--- a/pypy/objspace/std/test/test_unicodeobject.py
+++ b/pypy/objspace/std/test/test_unicodeobject.py
@@ -23,6 +23,10 @@
 print self.space.config.objspace.std.withrope
 assert len(warnings) == 2
 
+def test_listview_unicode(self):
+w_str = self.space.wrap(u'abcd')
+assert self.space.listview_unicode(w_str) == list(uabcd)
+
 
 class AppTestUnicodeStringStdOnly:
 def test_compares(self):
diff --git a/pypy/objspace/std/unicodeobject.py 
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -66,6 +66,15 @@
 def unicode_w(self, space):
 return self._value
 
+def listview_unicode(w_self):
+return _create_list_from_unicode(w_self._value)
+
+def _create_list_from_unicode(value):
+# need this helper function to allow the jit to look inside and inline
+# listview_unicode
+return [s for s in value]
+
+
 W_UnicodeObject.EMPTY = W_UnicodeObject(u'')
 
 registerimplementation(W_UnicodeObject)
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Tweak tweak. Unclear if this gives enough win any more to care...

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58653:66ca6d9f3739
Date: 2012-10-31 18:09 +0100
http://bitbucket.org/pypy/pypy/changeset/66ca6d9f3739/

Log:Tweak tweak. Unclear if this gives enough win any more to care...

diff --git a/pypy/objspace/std/test/test_typeobject.py 
b/pypy/objspace/std/test/test_typeobject.py
--- a/pypy/objspace/std/test/test_typeobject.py
+++ b/pypy/objspace/std/test/test_typeobject.py
@@ -1175,9 +1175,9 @@
 )
 w_A, w_B, w_M = space.unpackiterable(w_tup)
 
-assert w_A.w_bltin_new is None
-assert w_B.w_bltin_new is None
-assert w_M.w_bltin_new is None
+assert w_A.w_new_function is None
+assert w_B.w_new_function is None
+assert w_M.w_new_function is None
 
 _, w_object_newdescr = space.lookup_in_type_where(space.w_object,
   '__new__')
@@ -1185,17 +1185,18 @@
  w_type=space.w_object)
 
 w_a = space.call_function(w_A)
-assert w_A.w_bltin_new is w_object___new__
+assert w_A.w_new_function is w_object___new__
 
 # will shortcut
 w_a = space.call_function(w_A)
 
 w_b = space.call_function(w_B)
-assert w_B.w_bltin_new is None
+assert w_B.w_new_function is not None
+w_b = space.call_function(w_B)
 
 w_m = space.call_function(w_M, space.wrap('C'), space.newlist([]),
   space.newdict())
-assert w_M.w_bltin_new is None  
+assert w_M.w_new_function is not None
 
 
 class AppTestNewShortcut:
diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -113,10 +113,8 @@
 # for config.objspace.std.withidentitydict
 compares_by_identity_status = UNKNOWN
 
-# used to cache the type __new__ function if it comes from a builtin type
-# != 'type', in that case call__Type will also assumes the result
-# of the __new__ is an instance of the type
-w_bltin_new = None
+# used to cache the type's __new__ function
+w_new_function = None
 
 @dont_look_inside
 def __init__(w_self, space, name, bases_w, dict_w,
@@ -181,7 +179,7 @@
 w_self.compares_by_identity_status = UNKNOWN
 
 if space.config.objspace.std.newshortcut:
-w_self.w_bltin_new = None
+w_self.w_new_function = None
 
 if (space.config.objspace.std.withtypeversion
 and w_self._version_tag is not None):
@@ -824,32 +822,23 @@
 promote(w_type)
 # invoke the __new__ of the type
 if not we_are_jitted():
-# note that the annotator will figure out that w_type.w_bltin_new can
-# only be None if the newshortcut config option is not set
-w_bltin_new = w_type.w_bltin_new
+# note that the annotator will figure out that w_type.w_new_function
+# can only be None if the newshortcut config option is not set
+w_newfunc = w_type.w_new_function
 else:
 # for the JIT it is better to take the slow path because normal lookup
-# is nicely optimized, but the w_type.w_bltin_new attribute is not
+# is nicely optimized, but the w_type.w_new_function attribute is not
 # known to the JIT
-w_bltin_new = None
-call_init = True
-if w_bltin_new is not None:
-w_newobject = space.call_obj_args(w_bltin_new, w_type, __args__)
-else:
+w_newfunc = None
+if w_newfunc is None:
 w_newtype, w_newdescr = w_type.lookup_where('__new__')
 w_newfunc = space.get(w_newdescr, w_type)
 if (space.config.objspace.std.newshortcut and
 not we_are_jitted() and
-isinstance(w_newtype, W_TypeObject) and
-not w_newtype.is_heaptype() and
-not space.is_w(w_newtype, space.w_type)):
-w_type.w_bltin_new = w_bltin_new = w_newfunc
-w_newobject = space.call_obj_args(w_newfunc, w_type, __args__)
-call_init = space.isinstance_w(w_newobject, w_type)
-
-# sanity check
-if not we_are_translated() and w_bltin_new is not None:
-assert space.isinstance_w(w_newobject, w_type)
+isinstance(w_newtype, W_TypeObject)):
+w_type.w_new_function = w_newfunc
+w_newobject = space.call_obj_args(w_newfunc, w_type, __args__)
+call_init = space.isinstance_w(w_newobject, w_type)
 
 # maybe invoke the __init__ of the type
 if (call_init and not (space.is_w(w_type, space.w_type) and
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Comment it out until we figure out (1) if it has a measurable performance

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58654:3ef72b75102b
Date: 2012-10-31 18:10 +0100
http://bitbucket.org/pypy/pypy/changeset/3ef72b75102b/

Log:Comment it out until we figure out (1) if it has a measurable
performance impact nowadays, and (2) if it's really really really
correct

diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -372,7 +372,7 @@
 config.objspace.std.suggest(builtinshortcut=True)
 config.objspace.std.suggest(optimized_list_getitem=True)
 config.objspace.std.suggest(getattributeshortcut=True)
-config.objspace.std.suggest(newshortcut=True)
+#config.objspace.std.suggest(newshortcut=True)
 config.objspace.std.suggest(withspecialisedtuple=True)
 config.objspace.std.suggest(withidentitydict=True)
 #if not IS_64_BITS:
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix this test

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58655:bf186ea46cc9
Date: 2012-10-31 18:16 +0100
http://bitbucket.org/pypy/pypy/changeset/bf186ea46cc9/

Log:fix this test

diff --git a/pypy/interpreter/test/test_zzpickle_and_slow.py 
b/pypy/interpreter/test/test_zzpickle_and_slow.py
--- a/pypy/interpreter/test/test_zzpickle_and_slow.py
+++ b/pypy/interpreter/test/test_zzpickle_and_slow.py
@@ -6,7 +6,7 @@
 
 class AppTestSlow:
 def setup_class(cls):
-space = gettestobjspace()
+space = gettestobjspace(usemodules=['itertools'])
 cls.space = space
 if py.test.config.option.runappdirect:
 filename = __file__
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix this test too

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58656:2598c9981962
Date: 2012-10-31 18:18 +0100
http://bitbucket.org/pypy/pypy/changeset/2598c9981962/

Log:fix this test too

diff --git a/pypy/module/_multiprocessing/test/test_connection.py 
b/pypy/module/_multiprocessing/test/test_connection.py
--- a/pypy/module/_multiprocessing/test/test_connection.py
+++ b/pypy/module/_multiprocessing/test/test_connection.py
@@ -94,7 +94,7 @@
 class AppTestSocketConnection(BaseConnectionTest):
 def setup_class(cls):
 space = gettestobjspace(usemodules=('_multiprocessing', 'thread', 
'signal',
-'struct', 'array'))
+'struct', 'array', 'itertools'))
 cls.space = space
 cls.w_connections = space.newlist([])
 
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] extradoc extradoc: beginnings of another py3k update

2012-10-31 Thread pjenvey
Author: Philip Jenvey pjen...@underboss.org
Branch: extradoc
Changeset: r4897:99dabe072e29
Date: 2012-10-31 12:16 -0700
http://bitbucket.org/pypy/extradoc/changeset/99dabe072e29/

Log:beginnings of another py3k update

diff --git a/blog/draft/py3k-status-update-7.rst 
b/blog/draft/py3k-status-update-7.rst
new file mode 100644
--- /dev/null
+++ b/blog/draft/py3k-status-update-7.rst
@@ -0,0 +1,40 @@
+Py3k status update #7
+-
+
+This is the seventh status update about our work on the `py3k branch`_, which
+we can work on thanks to all of the people who donated_ to the `py3k
+proposal`_.
+
+There was an increased amount of activity this month.
+
+The `py3k buildbots`_ now fully translate the branch every night and run the
+Python standard library tests.
+
+We currently pass 160 out of approximately 355 test modules, fail 144 and skip
+apprixmately 51.
+
+o work on dictviews (keys/values/items)
+
+o _csv
+
+o more parser fixes, py3 list comprehension semantics
+
+o 2to3'd most of our custom lib_pypy
+
+o py3-enabled pyrepl (readline works in the repl!), builtins.input() (pdb 
seems to work!)
+
+o py3 round
+
+o further tightening/cleanup of the unicode handling (more usage of
+surrogateescape, surrogatepass among other things)
+
+o as well as keeping up with some big changes happening on the default branch
+
+Finally, I would like to thank Amaury Forgeot d'Arc for his significant
+contributions; among other things, Amaury recently worked on all kinds of
+stuff listed above
+
+.. _donated: 
http://morepypy.blogspot.com/2012/01/py3k-and-numpy-first-stage-thanks-to.html
+.. _`py3k proposal`: http://pypy.org/py3donate.html
+.. _`py3k branch`: https://bitbucket.org/pypy/pypy/src/py3k
+.. _`py3k buildbots`: http://buildbot.pypy.org/summary?branch=py3k
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: document merged branch

2012-10-31 Thread arigo
Author: Armin Rigo ar...@tunes.org
Branch: 
Changeset: r58657:37267ef01375
Date: 2012-10-31 20:38 +0100
http://bitbucket.org/pypy/pypy/changeset/37267ef01375/

Log:document merged branch

diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -42,6 +42,8 @@
 Improve dtypes intp, uintp, void, string and record
 .. branch: kill-someobject
 major cleanups including killing some object support
+.. branch: cpyext-PyThreadState_New
+implement threadstate-related functions in cpyext
 
 
 .. uninteresting branches that we should just ignore for the whatsnew:
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] extradoc extradoc: tweaks

2012-10-31 Thread antocuni
Author: Antonio Cuni anto.c...@gmail.com
Branch: extradoc
Changeset: r4898:be5b7511331f
Date: 2012-10-31 20:40 +0100
http://bitbucket.org/pypy/extradoc/changeset/be5b7511331f/

Log:tweaks

diff --git a/blog/draft/py3k-status-update-7.rst 
b/blog/draft/py3k-status-update-7.rst
--- a/blog/draft/py3k-status-update-7.rst
+++ b/blog/draft/py3k-status-update-7.rst
@@ -5,23 +5,33 @@
 we can work on thanks to all of the people who donated_ to the `py3k
 proposal`_.
 
-There was an increased amount of activity this month.
+The biggest news is that this month Philip started to work on py3k in parallel
+to Antonio. As such, there was an increased amount of activity.
 
 The `py3k buildbots`_ now fully translate the branch every night and run the
 Python standard library tests.
 
-We currently pass 160 out of approximately 355 test modules, fail 144 and skip
-apprixmately 51.
+We currently pass 160 out of approximately 355 modules of CPython's standard
+test suite, fail 144 and skip apprixmately 51.
 
-o work on dictviews (keys/values/items)
+Some highlights:
 
-o _csv
+o dictviews (the objects returned by dict.keys/values/items) has been greatly
+  improved, and now they full support set operators
 
-o more parser fixes, py3 list comprehension semantics
+o a lot of tests has been fixed wrt complex numbers (and in particular the
+``__complex__`` method)
+
+o _csv has been fixed and now it correctly handles unicode instead of bytes
+
+o more parser fixes, py3k list comprehension semantics; now you can no longer
+  access the list comprehension variable after it finishes
 
 o 2to3'd most of our custom lib_pypy
 
-o py3-enabled pyrepl (readline works in the repl!), builtins.input() (pdb 
seems to work!)
+o py3-enabled pyrepl: this means that finally readline works at the command
+  prompt, as well as builtins.input(). ``pdb`` seems to work, as well as
+  fancycompleter_ to get colorful TAB completions :-)
 
 o py3 round
 
@@ -34,6 +44,10 @@
 contributions; among other things, Amaury recently worked on all kinds of
 stuff listed above
 
+
+cheers,
+PhilipAntonio
+
 .. _donated: 
http://morepypy.blogspot.com/2012/01/py3k-and-numpy-first-stage-thanks-to.html
 .. _`py3k proposal`: http://pypy.org/py3donate.html
 .. _`py3k branch`: https://bitbucket.org/pypy/pypy/src/py3k
___
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit