# Ticket #11761: 11761_review.patch

File 11761_review.patch, 3.6 KB (added by jdemeyer, 10 years ago)
• ## sage/misc/misc_c.pyx

```# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1320135932 -3600
# Node ID 61240e91aea9415982181db4d9340dc37f7be2d5
# Parent  ef87efd57797f2c75f24e7df62edbf80219bce38
Cython 0.15.1 reviewer patch

diff --git a/sage/misc/misc_c.pyx b/sage/misc/misc_c.pyx```
 a Returns a list where the i-th entry is the sum of all entries up to (and including) i. INPUT: L     -- the list start -- (optional) a default start value - ``L`` -- the list EXAMPLES: - ``start`` -- (optional) a default start value EXAMPLES:: sage: running_total(range(5)) [0, 1, 3, 6, 10] sage: running_total("abcdef") ['a', 'ab', 'abc', 'abcd', 'abcde', 'abcdef'] sage: running_total("abcdef", start="%") ['%a', '%ab', '%abc', '%abcd', '%abcde', '%abcdef'] sage: running_total([1..10], start=100) [101, 103, 106, 110, 115, 121, 128, 136, 145, 155] sage: running_total([]) [] """ cdef bint first = 1 running = None running = [] total = start for x in L: if first: total = L[0] if start is None else L[0]+start running = [total] first = 0 continue total += x if total is None: # This is the first entry total = x else: total += x PyList_Append(running, total) return running
• ## sage/rings/integer.pyx

`diff --git a/sage/rings/integer.pyx b/sage/rings/integer.pyx`
 a r""" Returns ``True`` if ``self`` is prime. INPUT: - ``proof`` -- If False, use a strong pseudo-primality test. If True, use a provable primality test.  If unset, use the default arithmetic proof flag. .. note:: Integer primes are by definition *positive*! This is different than Magma, but the same as in PARI. See also the :meth:`.is_irreducible` method. :meth:`is_irreducible()` method. EXAMPLES:: sage: z.is_irreducible() True :: sage: z = 10^80 + 129 sage: z.is_prime(proof=False) True sage: z.is_prime(proof=True) True IMPLEMENTATION: Calls the PARI ``isprime`` function. """ from sage.structure.proof.proof import get_flag
• ## sage/rings/polynomial/pbori.pyx

`diff --git a/sage/rings/polynomial/pbori.pyx b/sage/rings/polynomial/pbori.pyx`
 a sage: I.groebner_basis() [1] """ msg = None cdef BooleanPolynomial p # we check for other PolyBoRi types first since this conversion # is used by the PolyBoRi python code often ... TypeError: cannot convert polynomial z*x^2 + 5*y^3 to Boolean PolynomialRing in x, y: name z not defined """ msg = None cdef int i try:
• ## sage/structure/coerce.pyx

`diff --git a/sage/structure/coerce.pyx b/sage/structure/coerce.pyx`
 a if action is not None: return (action)._call_(x, y) xy = None try: xy = None xy = self.canonical_coercion(x,y) return PyObject_CallObject(op, xy) except TypeError, err: