@@ -1272,11 +1272,12 @@ are always available. They are listed here in alphabetical order.
12721272 returns ``8364 ``. This is the inverse of :func: `chr `.
12731273
12741274
1275- .. function :: pow(x, y [, z ])
1275+ .. function :: pow(base, exp [, mod ])
12761276
1277- Return *x * to the power *y *; if *z * is present, return *x * to the power *y *,
1278- modulo *z * (computed more efficiently than ``pow(x, y) % z ``). The two-argument
1279- form ``pow(x, y) `` is equivalent to using the power operator: ``x**y ``.
1277+ Return *base * to the power *exp *; if *mod * is present, return *base * to the
1278+ power *exp *, modulo *mod * (computed more efficiently than
1279+ ``pow(base, exp) % mod ``). The two-argument form ``pow(base, exp) `` is
1280+ equivalent to using the power operator: ``base**exp ``.
12801281
12811282 The arguments must have numeric types. With mixed operand types, the
12821283 coercion rules for binary arithmetic operators apply. For :class: `int `
@@ -1285,14 +1286,15 @@ are always available. They are listed here in alphabetical order.
12851286 converted to float and a float result is delivered. For example, ``10**2 ``
12861287 returns ``100 ``, but ``10**-2 `` returns ``0.01 ``.
12871288
1288- For :class: `int ` operands *x * and *y *, if *z * is present, *z * must also be
1289- of integer type and *z * must be nonzero. If *z * is present and *y * is
1290- negative, *x * must be relatively prime to *z *. In that case, ``pow(inv_x,
1291- -y, z) `` is returned, where *inv_x * is an inverse to *x * modulo *z *.
1289+ For :class: `int ` operands *base * and *exp *, if *mod * is present, *mod * must
1290+ also be of integer type and *mod * must be nonzero. If *mod * is present and
1291+ *exp * is negative, *base * must be relatively prime to *mod *. In that case,
1292+ ``pow(inv_base, -exp, mod) `` is returned, where *inv_base * is an inverse to
1293+ *base * modulo *mod *.
12921294
12931295 Here's an example of computing an inverse for ``38 `` modulo ``97 ``::
12941296
1295- >>> pow(38, -1, 97)
1297+ >>> pow(38, -1, mod= 97)
12961298 23
12971299 >>> 23 * 38 % 97 == 1
12981300 True
@@ -1302,6 +1304,10 @@ are always available. They are listed here in alphabetical order.
13021304 the second argument to be negative, permitting computation of modular
13031305 inverses.
13041306
1307+ .. versionchanged :: 3.9
1308+ Allow keyword arguments. Formerly, only positional arguments were
1309+ supported.
1310+
13051311
13061312.. function :: print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)
13071313
0 commit comments