summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/stringio.c3
-rw-r--r--Modules/mathmodule.c36
-rw-r--r--Modules/operator.c28
3 files changed, 34 insertions, 33 deletions
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c
index ad9730d..c19c4c0 100644
--- a/Modules/_io/stringio.c
+++ b/Modules/_io/stringio.c
@@ -600,9 +600,6 @@ stringio_init(stringio *self, PyObject *args, PyObject *kwds)
assert((newline != NULL && newline_obj != Py_None) ||
(newline == NULL && newline_obj == Py_None));
- assert((newline != NULL && newline_obj != Py_None) ||
- (newline == NULL && newline_obj == Py_None));
-
if (newline) {
self->readnl = PyUnicode_FromString(newline);
if (self->readnl == NULL)
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 249c227..052fca1 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -661,7 +661,7 @@ PyDoc_STRVAR(math_ceil_doc,
"This is the smallest integral value >= x.");
FUNC2(copysign, copysign,
- "copysign(x,y)\n\nReturn x with the sign of y.")
+ "copysign(x, y)\n\nReturn x with the sign of y.")
FUNC1(cos, cos, 0,
"cos(x)\n\nReturn the cosine of x (measured in radians).")
FUNC1(cosh, cosh, 1,
@@ -695,8 +695,8 @@ PyDoc_STRVAR(math_floor_doc,
FUNC1A(gamma, m_tgamma,
"gamma(x)\n\nGamma function at x.")
FUNC1(log1p, log1p, 1,
- "log1p(x)\n\nReturn the natural logarithm of 1+x (base e).\n\
- The result is computed in a way which is accurate for x near zero.")
+ "log1p(x)\n\nReturn the natural logarithm of 1+x (base e).\n"
+ "The result is computed in a way which is accurate for x near zero.")
FUNC1(sin, sin, 0,
"sin(x)\n\nReturn the sine of x (measured in radians).")
FUNC1(sinh, sinh, 1,
@@ -925,7 +925,7 @@ _fsum_error:
#undef NUM_PARTIALS
PyDoc_STRVAR(math_fsum_doc,
-"sum(iterable)\n\n\
+"fsum(iterable)\n\n\
Return an accurate floating point sum of values in the iterable.\n\
Assumes IEEE-754 floating point arithmetic.");
@@ -1101,7 +1101,8 @@ math_ldexp(PyObject *self, PyObject *args)
}
PyDoc_STRVAR(math_ldexp_doc,
-"ldexp(x, i) -> x * (2**i)");
+"ldexp(x, i)\n\n\
+Return x * (2**i).");
static PyObject *
math_modf(PyObject *self, PyObject *arg)
@@ -1192,7 +1193,8 @@ math_log(PyObject *self, PyObject *args)
}
PyDoc_STRVAR(math_log_doc,
-"log(x[, base]) -> the logarithm of x to the given base.\n\
+"log(x[, base])\n\n\
+Return the logarithm of x to the given base.\n\
If the base not specified, returns the natural logarithm (base e) of x.");
static PyObject *
@@ -1202,7 +1204,7 @@ math_log10(PyObject *self, PyObject *arg)
}
PyDoc_STRVAR(math_log10_doc,
-"log10(x) -> the base 10 logarithm of x.");
+"log10(x)\n\nReturn the base 10 logarithm of x.");
static PyObject *
math_fmod(PyObject *self, PyObject *args)
@@ -1235,7 +1237,7 @@ math_fmod(PyObject *self, PyObject *args)
}
PyDoc_STRVAR(math_fmod_doc,
-"fmod(x,y)\n\nReturn fmod(x, y), according to platform C."
+"fmod(x, y)\n\nReturn fmod(x, y), according to platform C."
" x % y may differ.");
static PyObject *
@@ -1277,7 +1279,7 @@ math_hypot(PyObject *self, PyObject *args)
}
PyDoc_STRVAR(math_hypot_doc,
-"hypot(x,y)\n\nReturn the Euclidean distance, sqrt(x*x + y*y).");
+"hypot(x, y)\n\nReturn the Euclidean distance, sqrt(x*x + y*y).");
/* pow can't use math_2, but needs its own wrapper: the problem is
that an infinite result can arise either as a result of overflow
@@ -1364,7 +1366,7 @@ math_pow(PyObject *self, PyObject *args)
}
PyDoc_STRVAR(math_pow_doc,
-"pow(x,y)\n\nReturn x**y (x to the power of y).");
+"pow(x, y)\n\nReturn x**y (x to the power of y).");
static const double degToRad = Py_MATH_PI / 180.0;
static const double radToDeg = 180.0 / Py_MATH_PI;
@@ -1379,7 +1381,8 @@ math_degrees(PyObject *self, PyObject *arg)
}
PyDoc_STRVAR(math_degrees_doc,
-"degrees(x) -> converts angle x from radians to degrees");
+"degrees(x)\n\n\
+Convert angle x from radians to degrees.");
static PyObject *
math_radians(PyObject *self, PyObject *arg)
@@ -1391,7 +1394,8 @@ math_radians(PyObject *self, PyObject *arg)
}
PyDoc_STRVAR(math_radians_doc,
-"radians(x) -> converts angle x from degrees to radians");
+"radians(x)\n\n\
+Convert angle x from degrees to radians.");
static PyObject *
math_isnan(PyObject *self, PyObject *arg)
@@ -1403,8 +1407,8 @@ math_isnan(PyObject *self, PyObject *arg)
}
PyDoc_STRVAR(math_isnan_doc,
-"isnan(x) -> bool\n\
-Checks if float x is not a number (NaN)");
+"isnan(x) -> bool\n\n\
+Check if float x is not a number (NaN).");
static PyObject *
math_isinf(PyObject *self, PyObject *arg)
@@ -1416,8 +1420,8 @@ math_isinf(PyObject *self, PyObject *arg)
}
PyDoc_STRVAR(math_isinf_doc,
-"isinf(x) -> bool\n\
-Checks if float x is infinite (positive or negative)");
+"isinf(x) -> bool\n\n\
+Check if float x is infinite (positive or negative).");
static PyMethodDef math_methods[] = {
{"acos", math_acos, METH_O, math_acos_doc},
diff --git a/Modules/operator.c b/Modules/operator.c
index 0ba8b09..85d662d 100644
--- a/Modules/operator.c
+++ b/Modules/operator.c
@@ -7,7 +7,7 @@ PyDoc_STRVAR(operator_doc,
This module exports a set of functions implemented in C corresponding\n\
to the intrinsic operators of Python. For example, operator.add(x, y)\n\
is equivalent to the expression x+y. The function names are those\n\
-used for special class methods; variants without leading and trailing\n\
+used for special methods; variants without leading and trailing\n\
'__' are also provided for convenience.");
#define spam1(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a1) { \
@@ -197,21 +197,21 @@ spam2o(not_,__not__, "not_(a) -- Same as not a.")
spam2(and_,__and__, "and_(a, b) -- Same as a & b.")
spam2(xor,__xor__, "xor(a, b) -- Same as a ^ b.")
spam2(or_,__or__, "or_(a, b) -- Same as a | b.")
-spam2(iadd,__iadd__, "iadd(a, b) -- Same as a += b.")
-spam2(isub,__isub__, "isub(a, b) -- Same as a -= b.")
-spam2(imul,__imul__, "imul(a, b) -- Same as a *= b.")
-spam2(ifloordiv,__ifloordiv__, "ifloordiv(a, b) -- Same as a //= b.")
-spam2(itruediv,__itruediv__, "itruediv(a, b) -- Same as a /= b.")
-spam2(imod,__imod__, "imod(a, b) -- Same as a %= b.")
-spam2(ilshift,__ilshift__, "ilshift(a, b) -- Same as a <<= b.")
-spam2(irshift,__irshift__, "irshift(a, b) -- Same as a >>= b.")
-spam2(iand,__iand__, "iand(a, b) -- Same as a &= b.")
-spam2(ixor,__ixor__, "ixor(a, b) -- Same as a ^= b.")
-spam2(ior,__ior__, "ior(a, b) -- Same as a |= b.")
+spam2(iadd,__iadd__, "a = iadd(a, b) -- Same as a += b.")
+spam2(isub,__isub__, "a = isub(a, b) -- Same as a -= b.")
+spam2(imul,__imul__, "a = imul(a, b) -- Same as a *= b.")
+spam2(ifloordiv,__ifloordiv__, "a = ifloordiv(a, b) -- Same as a //= b.")
+spam2(itruediv,__itruediv__, "a = itruediv(a, b) -- Same as a /= b")
+spam2(imod,__imod__, "a = imod(a, b) -- Same as a %= b.")
+spam2(ilshift,__ilshift__, "a = ilshift(a, b) -- Same as a <<= b.")
+spam2(irshift,__irshift__, "a = irshift(a, b) -- Same as a >>= b.")
+spam2(iand,__iand__, "a = iand(a, b) -- Same as a &= b.")
+spam2(ixor,__ixor__, "a = ixor(a, b) -- Same as a ^= b.")
+spam2(ior,__ior__, "a = ior(a, b) -- Same as a |= b.")
spam2(concat,__concat__,
"concat(a, b) -- Same as a + b, for a and b sequences.")
spam2(iconcat,__iconcat__,
- "iconcat(a, b) -- Same as a += b, for a and b sequences.")
+ "a = iconcat(a, b) -- Same as a += b, for a and b sequences.")
spam2(getitem,__getitem__,
"getitem(a, b) -- Same as a[b].")
spam2(setitem,__setitem__,
@@ -219,7 +219,7 @@ spam2(setitem,__setitem__,
spam2(delitem,__delitem__,
"delitem(a, b) -- Same as del a[b].")
spam2(pow,__pow__, "pow(a, b) -- Same as a ** b.")
-spam2(ipow,__ipow__, "ipow(a, b) -- Same as a **= b.")
+spam2(ipow,__ipow__, "a = ipow(a, b) -- Same as a **= b.")
spam2(lt,__lt__, "lt(a, b) -- Same as a<b.")
spam2(le,__le__, "le(a, b) -- Same as a<=b.")
spam2(eq,__eq__, "eq(a, b) -- Same as a==b.")