Hello community, here is the log from the commit of package python3-Cython for openSUSE:Factory checked in at 2016-04-03 23:05:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-Cython (Old) and /work/SRC/openSUSE:Factory/.python3-Cython.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-Cython" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-Cython/python3-Cython.changes 2016-02-23 16:54:47.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-Cython.new/python3-Cython.changes 2016-04-03 23:05:41.000000000 +0200 @@ -1,0 +2,23 @@ +Sun Mar 27 05:54:43 UTC 2016 - a...@gmx.de + +- specfile: + * removed python3-Cython-prevent_swallowing_StopIteration_return.patch + included upstream + +- update to version 0.23.5: + * Compile errors and warnings in integer type conversion code. This + fixes ticket 877. Patches by Christian Neukirchen, Nikolaus Rath, + Ian Henriksen. + * Reference leak when "*args" argument was reassigned in closures. + * Truth-testing Unicode strings could waste time and memory in + Py3.3+. + * Return values of async functions could be ignored and replaced by + None. + * Compiler crash in CPython 3.6. + * Fix prange() to behave identically to range(). The end condition + was miscalculated when the range was not exactly divisible by the + step. + * Optimised all(genexpr)/any(genexpr) calls could warn about unused + code. This fixes ticket 876. + +------------------------------------------------------------------- Old: ---- Cython-0.23.4.tar.gz python3-Cython-prevent_swallowing_StopIteration_return.patch New: ---- Cython-0.23.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-Cython.spec ++++++ --- /var/tmp/diff_new_pack.6nT0ur/_old 2016-04-03 23:05:42.000000000 +0200 +++ /var/tmp/diff_new_pack.6nT0ur/_new 2016-04-03 23:05:42.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-Cython -Version: 0.23.4 +Version: 0.23.5 Release: 0 Url: http://www.cython.org Summary: The Cython compiler for writing C extensions for the Python language @@ -26,8 +26,6 @@ Source: http://pypi.python.org/packages/source/C/Cython/Cython-%{version}.tar.gz Source1: python3-Cython-rpmlintrc Patch1: python3-Cython-c++11.patch -# PATCH-FIX-UPSTREAM python3-Cython-prevent_swallowing_StopIteration_return.patch - fix await compatibility for python 3.5.1 -Patch2: python3-Cython-prevent_swallowing_StopIteration_return.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: fdupes BuildRequires: gcc-c++ @@ -56,7 +54,6 @@ %prep %setup -q -n Cython-%{version} %patch1 -%patch2 -p1 sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py # Fix non-executable scripts # Fix EOL encoding sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c # Fix EOL encoding ++++++ Cython-0.23.4.tar.gz -> Cython-0.23.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/.gitrev new/Cython-0.23.5/.gitrev --- old/Cython-0.23.4/.gitrev 2015-10-10 14:31:40.000000000 +0200 +++ new/Cython-0.23.5/.gitrev 2016-03-25 05:28:54.000000000 +0100 @@ -1 +1 @@ -dc00a176d896f0df892aad8b305d946d3ed632a0 +55b55a393c6c7defb2b6e7544065eb0531f974cc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/CHANGES.rst new/Cython-0.23.5/CHANGES.rst --- old/Cython-0.23.4/CHANGES.rst 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/CHANGES.rst 2016-03-25 05:28:52.000000000 +0100 @@ -2,6 +2,30 @@ Cython Changelog ================ +0.23.5 (2016-03-26) +=================== + +Bugs fixed +---------- + +* Compile errors and warnings in integer type conversion code. This fixes + ticket 877. Patches by Christian Neukirchen, Nikolaus Rath, Ian Henriksen. + +* Reference leak when "*args" argument was reassigned in closures. + +* Truth-testing Unicode strings could waste time and memory in Py3.3+. + +* Return values of async functions could be ignored and replaced by ``None``. + +* Compiler crash in CPython 3.6. + +* Fix prange() to behave identically to range(). The end condition was + miscalculated when the range was not exactly divisible by the step. + +* Optimised ``all(genexpr)``/``any(genexpr)`` calls could warn about unused + code. This fixes ticket 876. + + 0.23.4 (2015-10-10) =================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Compiler/ExprNodes.py new/Cython-0.23.5/Cython/Compiler/ExprNodes.py --- old/Cython-0.23.4/Cython/Compiler/ExprNodes.py 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/Cython/Compiler/ExprNodes.py 2016-03-25 05:28:52.000000000 +0100 @@ -11997,7 +11997,7 @@ Builtin.set_type: 'PySet_GET_SIZE', Builtin.frozenset_type: 'PySet_GET_SIZE', Builtin.bytes_type: 'PyBytes_GET_SIZE', - Builtin.unicode_type: 'PyUnicode_GET_SIZE', + Builtin.unicode_type: '__Pyx_PyUnicode_GET_LENGTH', } def __init__(self, arg, env): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Compiler/FlowControl.py new/Cython-0.23.5/Cython/Compiler/FlowControl.py --- old/Cython-0.23.4/Cython/Compiler/FlowControl.py 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/Cython/Compiler/FlowControl.py 2016-03-25 05:28:52.000000000 +0100 @@ -341,6 +341,14 @@ return self.entry.type return self.inferred_type + def __getstate__(self): + return (self.lhs, self.rhs, self.entry, self.pos, + self.refs, self.is_arg, self.is_deletion, self.inferred_type) + + def __setstate__(self, state): + (self.lhs, self.rhs, self.entry, self.pos, + self.refs, self.is_arg, self.is_deletion, self.inferred_type) = state + class StaticAssignment(NameAssignment): """Initialised at declaration time, e.g. stack allocation.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Compiler/Nodes.py new/Cython-0.23.5/Cython/Compiler/Nodes.py --- old/Cython-0.23.4/Cython/Compiler/Nodes.py 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/Cython/Compiler/Nodes.py 2016-03-25 05:28:52.000000000 +0100 @@ -1895,7 +1895,7 @@ elif is_cdef and entry.type.is_memoryviewslice and len(entry.cf_assignments) > 1: code.put_incref_memoryviewslice(entry.cname, have_gil=code.funcstate.gil_owned) for entry in lenv.var_entries: - if entry.is_arg and len(entry.cf_assignments) > 1: + if entry.is_arg and len(entry.cf_assignments) > 1 and not entry.in_closure: if entry.xdecref_cleanup: code.put_var_xincref(entry) else: @@ -8541,7 +8541,7 @@ self.control_flow_var_code_point = code.insertion_point() # Note: nsteps is private in an outer scope if present - code.putln("%(nsteps)s = (%(stop)s - %(start)s) / %(step)s;" % fmt_dict) + code.putln("%(nsteps)s = (%(stop)s - %(start)s + %(step)s - %(step)s/abs(%(step)s)) / %(step)s;" % fmt_dict) # The target iteration variable might not be initialized, do it only if # we are executing at least 1 iteration, otherwise we should leave the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Compiler/Optimize.py new/Cython-0.23.5/Cython/Compiler/Optimize.py --- old/Cython-0.23.4/Cython/Compiler/Optimize.py 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/Cython/Compiler/Optimize.py 2016-03-25 05:28:52.000000000 +0100 @@ -1503,40 +1503,32 @@ def _handle_simple_function_all(self, node, pos_args): """Transform - _result = all(x for L in LL for x in L) + _result = all(p(x) for L in LL for x in L) into for L in LL: for x in L: - if not x: - _result = False - break - else: - continue - break + if not p(x): + return False else: - _result = True + return True """ return self._transform_any_all(node, pos_args, False) def _handle_simple_function_any(self, node, pos_args): """Transform - _result = any(x for L in LL for x in L) + _result = any(p(x) for L in LL for x in L) into for L in LL: for x in L: - if x: - _result = True - break - else: - continue - break + if p(x): + return True else: - _result = False + return False """ return self._transform_any_all(node, pos_args, True) @@ -1567,15 +1559,6 @@ value=ExprNodes.BoolNode(yield_expression.pos, value=is_any, constant_result=is_any)) )] ) - loop = loop_node - while isinstance(loop.body, Nodes.LoopNode): - next_loop = loop.body - loop.body = Nodes.StatListNode(loop.body.pos, stats=[ - loop.body, - Nodes.BreakStatNode(yield_expression.pos) - ]) - next_loop.else_clause = Nodes.ContinueStatNode(yield_expression.pos) - loop = next_loop loop_node.else_clause = Nodes.ReturnStatNode( node.pos, value=ExprNodes.BoolNode(yield_expression.pos, value=not is_any, constant_result=not is_any)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Compiler/PyrexTypes.py new/Cython-0.23.5/Cython/Compiler/PyrexTypes.py --- old/Cython-0.23.4/Cython/Compiler/PyrexTypes.py 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/Cython/Compiler/PyrexTypes.py 2016-03-25 05:28:52.000000000 +0100 @@ -4145,6 +4145,10 @@ def widest_numeric_type(type1, type2): """Given two numeric types, return the narrowest type encompassing both of them. """ + if type1.is_reference: + type1 = type1.ref_base_type + if type2.is_reference: + type2 = type2.ref_base_type if type1 == type2: widest_type = type1 elif type1.is_complex or type2.is_complex: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Compiler/Tests/TestFlowControl.py new/Cython-0.23.5/Cython/Compiler/Tests/TestFlowControl.py --- old/Cython-0.23.4/Cython/Compiler/Tests/TestFlowControl.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Cython-0.23.5/Cython/Compiler/Tests/TestFlowControl.py 2016-03-25 05:28:52.000000000 +0100 @@ -0,0 +1,68 @@ + +from __future__ import absolute_import + +from copy import deepcopy +from unittest import TestCase + +from Cython.Compiler.FlowControl import ( + NameAssignment, StaticAssignment, Argument, NameDeletion) + + +class FakeType(object): + is_pyobject = True + + +class FakeNode(object): + pos = ('filename.pyx', 1, 2) + cf_state = None + type = FakeType() + + def infer_type(self, scope): + return self.type + + +class FakeEntry(object): + type = FakeType() + + +class TestGraph(TestCase): + def test_deepcopy(self): + lhs, rhs = FakeNode(), FakeNode() + entry = FakeEntry() + entry.pos = lhs.pos + + name_ass = NameAssignment(lhs, rhs, entry) + ass = deepcopy(name_ass) + self.assertTrue(ass.lhs) + self.assertTrue(ass.rhs) + self.assertTrue(ass.entry) + self.assertEqual(ass.pos, name_ass.pos) + self.assertFalse(ass.is_arg) + self.assertFalse(ass.is_deletion) + + static_ass = StaticAssignment(entry) + ass = deepcopy(static_ass) + self.assertTrue(ass.lhs) + self.assertTrue(ass.rhs) + self.assertTrue(ass.entry) + self.assertEqual(ass.pos, static_ass.pos) + self.assertFalse(ass.is_arg) + self.assertFalse(ass.is_deletion) + + arg_ass = Argument(lhs, rhs, entry) + ass = deepcopy(arg_ass) + self.assertTrue(ass.lhs) + self.assertTrue(ass.rhs) + self.assertTrue(ass.entry) + self.assertEqual(ass.pos, arg_ass.pos) + self.assertTrue(ass.is_arg) + self.assertFalse(ass.is_deletion) + + name_del = NameDeletion(lhs, entry) + ass = deepcopy(name_del) + self.assertTrue(ass.lhs) + self.assertTrue(ass.rhs) + self.assertTrue(ass.entry) + self.assertEqual(ass.pos, name_del.pos) + self.assertFalse(ass.is_arg) + self.assertTrue(ass.is_deletion) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Coverage.py new/Cython-0.23.5/Cython/Coverage.py --- old/Cython-0.23.4/Cython/Coverage.py 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/Cython/Coverage.py 2016-03-25 05:28:52.000000000 +0100 @@ -132,7 +132,7 @@ try: with open(c_file, 'rb') as f: if b'/* Generated by Cython ' not in f.read(30): - return None # not a Cython file + return None, None # not a Cython file except (IOError, OSError): c_file = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Shadow.py new/Cython-0.23.5/Cython/Shadow.py --- old/Cython-0.23.4/Cython/Shadow.py 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/Cython/Shadow.py 2016-03-25 05:28:52.000000000 +0100 @@ -1,7 +1,7 @@ # cython.* namespace for pure mode. from __future__ import absolute_import -__version__ = "0.23.4" +__version__ = "0.23.5" try: from __builtin__ import basestring diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Utility/Coroutine.c new/Cython-0.23.5/Cython/Utility/Coroutine.c --- old/Cython-0.23.4/Cython/Utility/Coroutine.c 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/Cython/Utility/Coroutine.c 2016-03-25 05:28:52.000000000 +0100 @@ -560,8 +560,7 @@ #endif { if (value == Py_None) - // FIXME - is this the right thing to do? - ret = PyIter_Next(yf); + ret = Py_TYPE(yf)->tp_iternext(yf); else ret = __Pyx_PyObject_CallMethod1(yf, PYIDENT("send"), value); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Utility/Optimize.c new/Cython-0.23.5/Cython/Utility/Optimize.c --- old/Cython-0.23.4/Cython/Utility/Optimize.c 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/Cython/Utility/Optimize.c 2016-03-25 05:28:52.000000000 +0100 @@ -661,7 +661,8 @@ x = a % b; x += ((x != 0) & ((x ^ b) < 0)) * b; {{elif op == 'TrueDivide'}} - if (8 * sizeof(long) <= 53 || (__Pyx_sst_abs(size) <= 52 / PyLong_SHIFT) || likely(labs({{ival}}) <= (1L << 53))) { + if ((8 * sizeof(long) <= 53 || likely(labs({{ival}}) <= (1L << 53))) + || __Pyx_sst_abs(size) <= 52 / PyLong_SHIFT) { return PyFloat_FromDouble((double)a / (double)b); } return PyLong_Type.tp_as_number->nb_{{slot_name}}(op1, op2); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/Cython/Utility/TypeConversion.c new/Cython-0.23.5/Cython/Utility/TypeConversion.c --- old/Cython-0.23.4/Cython/Utility/TypeConversion.c 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/Cython/Utility/TypeConversion.c 2016-03-25 05:28:52.000000000 +0100 @@ -667,7 +667,7 @@ const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return ({{TYPE}}) 0; - case -1: __PYX_VERIFY_RETURN_INT({{TYPE}}, sdigit, -(sdigit) digits[0]) + case -1: __PYX_VERIFY_RETURN_INT({{TYPE}}, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT({{TYPE}}, digit, +digits[0]) {{for _size in (2, 3, 4)}} {{for _case in (-_size, _size)}} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/PKG-INFO new/Cython-0.23.5/PKG-INFO --- old/Cython-0.23.4/PKG-INFO 2015-10-10 14:31:41.000000000 +0200 +++ new/Cython-0.23.5/PKG-INFO 2016-03-25 05:28:55.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: Cython -Version: 0.23.4 +Version: 0.23.5 Summary: The Cython compiler for writing C extensions for the Python language. Home-page: http://cython.org/ Author: Robert Bradshaw, Stefan Behnel, Dag Seljebotn, Greg Ewing, et al. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/docs/src/userguide/debugging.rst new/Cython-0.23.5/docs/src/userguide/debugging.rst --- old/Cython-0.23.4/docs/src/userguide/debugging.rst 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/docs/src/userguide/debugging.rst 2016-03-25 05:28:52.000000000 +0100 @@ -18,7 +18,7 @@ This can be achieved from within the setup script by passing ``gdb_debug=True`` to ``cythonize()``:: - from distutils.code import setup + from distutils.core import setup from distutils.extension import Extension extensions = [Extension('source', ['source.pyx'])] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/tests/run/all.pyx new/Cython-0.23.5/tests/run/all.pyx --- old/Cython-0.23.4/tests/run/all.pyx 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/tests/run/all.pyx 2016-03-25 05:28:52.000000000 +0100 @@ -1,3 +1,5 @@ +# mode: run +# tag: all, builtins, werror cdef class VerboseGetItem(object): cdef object sequence @@ -53,6 +55,7 @@ """ return all(x) + @cython.test_assert_path_exists( "//ForInStatNode", "//InlinedGeneratorExpressionNode" @@ -86,6 +89,7 @@ """ return all(x for x in seq) + @cython.test_assert_path_exists( "//ForInStatNode", "//InlinedGeneratorExpressionNode" @@ -122,6 +126,7 @@ assert x == 'abc' return result + @cython.test_assert_path_exists( "//ForInStatNode", "//InlinedGeneratorExpressionNode" @@ -158,10 +163,12 @@ """ return all(x%3 for x in seq if x%2 == 1) + mixed_ustring = u'AbcDefGhIjKlmnoP' lower_ustring = mixed_ustring.lower() upper_ustring = mixed_ustring.upper() + @cython.test_assert_path_exists( '//PythonCapiCallNode', '//ForFromStatNode' @@ -181,6 +188,7 @@ """ return all(uchar.islower() for uchar in ustring) + @cython.test_assert_path_exists( "//ForInStatNode", "//InlinedGeneratorExpressionNode", @@ -217,6 +225,7 @@ cdef int x return all(x for x in seq) + @cython.test_assert_path_exists( "//ForInStatNode", "//InlinedGeneratorExpressionNode", @@ -268,6 +277,14 @@ 1 2 False + >>> all_in_double_gen([VerboseGetItem([1,1,1]),VerboseGetItem([1,0,1]),VerboseGetItem([1,1])]) + 0 + 1 + 2 + 3 + 0 + 1 + False """ cdef int x return all(x for L in seq for x in L) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/tests/run/closure_leak_1.pyx new/Cython-0.23.5/tests/run/closure_leak_1.pyx --- old/Cython-0.23.4/tests/run/closure_leak_1.pyx 1970-01-01 01:00:00.000000000 +0100 +++ new/Cython-0.23.5/tests/run/closure_leak_1.pyx 2016-03-25 05:28:52.000000000 +0100 @@ -0,0 +1,11 @@ +# mode: run +# tag: closure + +def reassign_args(x, *args): + """ + >>> reassign_args(1, [1,2,3,4]) + """ + a,args = args[0], args[1:] + b = False + if b: + c = x.map_coefficients(lambda c: c(*args)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/tests/run/control_flow_loop.pyx new/Cython-0.23.5/tests/run/control_flow_loop.pyx --- old/Cython-0.23.4/tests/run/control_flow_loop.pyx 1970-01-01 01:00:00.000000000 +0100 +++ new/Cython-0.23.5/tests/run/control_flow_loop.pyx 2016-03-25 05:28:52.000000000 +0100 @@ -0,0 +1,55 @@ +# mode: run +# tag: forin, control-flow, werror + +def for_in_break(LL, p=bool): + """ + >>> for_in_break([[1,2,3], [4,5,6]]) + True + >>> for_in_break([[1,2,3], [4,5,0]]) + False + >>> for_in_break([[1,2,3], [0,4,5]]) + False + >>> for_in_break([[1,2,3], [0,4,5], [6,7,8]]) + False + + >>> def collect(x): + ... v.append(x) + ... return x + + >>> v = [] + >>> for_in_break([[1,2,3], [4,5,6]], p=collect) + True + >>> v + [1, 2, 3, 4, 5, 6] + + >>> v = [] + >>> for_in_break([[1,2,3], [4,5,0]], p=collect) + False + >>> v + [1, 2, 3, 4, 5, 0] + + >>> v = [] + >>> for_in_break([[1,2,3], [0,4,5]], p=collect) + False + >>> v + [1, 2, 3, 0] + + >>> v = [] + >>> for_in_break([[1,2,3], [0,4,5], [6,7,8]], p=collect) + False + >>> v + [1, 2, 3, 0] + """ + result = 'NOK' + # implements the builtin all() + for L in LL: + for x in L: + if not p(x): + result = False + break + else: + continue + break + else: + result = True + return result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.23.4/tests/run/sequential_parallel.pyx new/Cython-0.23.5/tests/run/sequential_parallel.pyx --- old/Cython-0.23.4/tests/run/sequential_parallel.pyx 2015-10-10 14:31:38.000000000 +0200 +++ new/Cython-0.23.5/tests/run/sequential_parallel.pyx 2016-03-25 05:28:52.000000000 +0100 @@ -46,6 +46,34 @@ return sum +def test_prange_matches_range(int start, int stop, int step): + """ + >>> test_prange_matches_range(0, 8, 3) + >>> test_prange_matches_range(0, 9, 3) + >>> test_prange_matches_range(0, 10, 3) + + >>> test_prange_matches_range(0, 10, -3) + + >>> test_prange_matches_range(0, -10, -3) + >>> test_prange_matches_range(1, -10, -3) + >>> test_prange_matches_range(2, -10, -3) + >>> test_prange_matches_range(3, -10, -3) + """ + cdef int i, range_last, prange_last + prange_set = set() + for i in prange(start, stop, step, nogil=True, num_threads=3): + prange_last = i + with gil: + prange_set.add(i) + range_set = set(range(start, stop, step)) + assert range_set == prange_set, "missing: %s extra %s" % (sorted(range_set-prange_set), sorted(prange_set - range_set)) + for ii in range(start, stop, step): + range_last = ii + if range_set: + assert prange_last == i + assert range_last == prange_last + + def test_propagation(): """ >>> test_propagation()