8000 [3.12] gh-125957: sync argument naming in sphinx docs of the cmath an… · python/cpython@ce85eb5 · GitHub
[go: up one dir, main page]

Skip to content

Commit ce85eb5

Browse files
miss-islingtonskirpichevpicnixz
authored
[3.12] gh-125957: sync argument naming in sphinx docs of the cmath and help() (GH-125958) (#131963)
gh-125957: sync argument naming in sphinx docs of the cmath and help() (GH-125958) (cherry picked from commit 0a3eb88) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent b1bbd01 commit ce85eb5

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

Doc/library/cmath.rst

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ segment that joins the origin to *z*.
5555
The following functions can be used to convert from the native
5656
rectangular coordinates to polar coordinates and back.
5757

58-
.. function:: phase(x)
58+
.. function:: phase(z)
5959

60-
Return the phase of *x* (also known as the *argument* of *x*), as a float.
61-
``phase(x)`` is equivalent to ``math.atan2(x.imag, x.real)``. The result
60+
Return the phase of *z* (also known as the *argument* of *z*), as a float.
61+
``phase(z)`` is equivalent to ``math.atan2(z.imag, z.real)``. The result
6262
lies in the range [-\ *π*, *π*], and the branch cut for this operation lies
6363
along the negative real axis. The sign of the result is the same as the
64-
sign of ``x.imag``, even when ``x.imag`` is zero::
64+
sign of ``z.imag``, even when ``z.imag`` is zero::
6565

6666
>>> phase(complex(-1.0, 0.0))
6767
3.141592653589793
@@ -71,147 +71,147 @@ rectangular coordinates to polar coordinates and back.
7171

7272
.. note::
7373

74-
The modulus (absolute value) of a complex number *x* can be
74+
The modulus (absolute value) of a complex number *z* can be
7575
computed using the built-in :func:`abs` function. There is no
7676
separate :mod:`cmath` module function for this operation.
7777

7878

79-
.. function:: polar(x)
79+
.. function:: polar(z)
8080

81-
Return the representation of *x* in polar coordinates. Returns a
82-
pair ``(r, phi)`` where *r* is the modulus of *x* and phi is the
83-
phase of *x*. ``polar(x)`` is equivalent to ``(abs(x),
84-
phase(x))``.
81+
Return the representation of *z* in polar coordinates. Returns a
82+
pair ``(r, phi)`` where *r* is the modulus of *z* and *phi* is the
83+
phase of *z*. ``polar(z)`` is equivalent to ``(abs(z),
84+
phase(z))``.
8585

8686

8787
.. function:: rect(r, phi)
8888

89-
Return the complex number *x* with polar coordinates *r* and *phi*.
89+
Return the complex number *z* with polar coordinates *r* and *phi*.
9090
Equivalent to ``complex(r * math.cos(phi), r * math.sin(phi))``.
9191

9292

9393
Power and logarithmic functions
9494
-------------------------------
9595

96-
.. function:: exp(x)
96+
.. function:: exp(z)
9797

98-
Return *e* raised to the power *x*, where *e* is the base of natural
98+
Return *e* raised to the power *z*, where *e* is the base of natural
9999
logarithms.
100100

101101

102-
.. function:: log(x[, base])
102+
.. function:: log(z[, base])
103103

104-
Returns the logarithm of *x* to the given *base*. If the *base* is not
105-
specified, returns the natural logarithm of *x*. There is one branch cut,
104+
Return the logarithm of *z* to the given *base*. If the *base* is not
105+
specified, returns the natural logarithm of *z*. There is one branch cut,
106106
from 0 along the negative real axis to -∞.
107107

108108

109-
.. function:: log10(x)
109+
.. function:: log10(z)
110110

111-
Return the base-10 logarithm of *x*. This has the same branch cut as
111+
Return the base-10 logarithm of *z*. This has the same branch cut as
112112
:func:`log`.
113113

114114

115-
.. function:: sqrt(x)
115+
.. function:: sqrt(z)
116116

117-
Return the square root of *x*. This has the same branch cut as :func:`log`.
117+
Return the square root of *z*. This has the same branch cut as :func:`log`.
118118

119119

120120
Trigonometric functions
121121
-----------------------
122122

123-
.. function:: acos(x)
123+
.. function:: acos(z)
124124

125-
Return the arc cosine of *x*. There are two branch cuts: One extends right
125+
Return the arc cosine of *z*. There are two branch cuts: One extends right
126126
from 1 along the real axis to ∞. The other extends left from -1 along the
127127
real axis to -∞.
128128

129129

130-
.. function:: asin(x)
130+
.. function:: asin(z)
131131

132-
Return the arc sine of *x*. This has the same branch cuts as :func:`acos`.
132+
Return the arc sine of *z*. This has the same branch cuts as :func:`acos`.
133133

134134

135-
.. function:: atan(x)
135+
.. function:: atan(z)
136136

137-
Return the arc tangent of *x*. There are two branch cuts: One extends from
137+
Return the arc tangent of *z*. There are two branch cuts: One extends from
138138
``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j``
139139
along the imaginary axis to ``-∞j``.
140140

141141

142-
.. function:: cos(x)
142+
.. function:: cos(z)
143143

144-
Return the cosine of *x*.
144+
Return the cosine of *z*.
145145

146146

147-
.. function:: sin(x)
147+
.. function:: sin(z)
148148

149-
Return the sine of *x*.
149+
Return the sine of *z*.
150150

151151

152-
.. function:: tan(x)
152+
.. function:: tan(z)
153153

154-
Return the tangent of *x*.
154+
Return the tangent of *z*.
155155

156156

157157
Hyperbolic functions
158158
--------------------
159159

160-
.. function:: acosh(x)
160+
.. function:: acosh(z)
161161

162-
Return the inverse hyperbolic cosine of *x*. There is one branch cut,
162+
Return the inverse hyperbolic cosine of *z*. There is one branch cut,
163163
extending left from 1 along the real axis to -∞.
164164

165165

166-
.. function:: asinh(x)
166+
.. function:: asinh(z)
167167

168-
Return the inverse hyperbolic sine of *x*. There are two branch cuts:
168+
Return the inverse hyperbolic sine of *z*. There are two branch cuts:
169169
One extends from ``1j`` along the imaginary axis to ``∞j``. The other
170170
extends from ``-1j`` along the imaginary axis to ``-∞j``.
171171

172172

173-
.. function:: atanh(x)
173+
.. function:: atanh(z)
174174

175-
Return the inverse hyperbolic tangent of *x*. There are two branch cuts: One
175+
Return the inverse hyperbolic tangent of *z*. There are two branch cuts: One
176176
extends from ``1`` along the real axis to ````. The other extends from
177177
``-1`` along the real axis to ``-∞``.
178178

179179

180-
.. function:: cosh(x)
180+
.. function:: cosh(z)
181181

182-
Return the hyperbolic cosine of *x*.
182+
Return the hyperbolic cosine of *z*.
183183

184184

185-
.. function:: sinh(x)
185+
.. function:: sinh(z)
186186

187-
Return the hyperbolic sine of *x*.
187+
Return the hyperbolic sine of *z*.
188188

189189

190-
.. function:: tanh(x)
190+
.. function:: tanh(z)
191191

192-
Return the hyperbolic tangent of *x*.
192+
Return the hyperbolic tangent of *z*.
193193

194194

195195
Classification functions
196196
------------------------
197197

198-
.. function:: isfinite(x)
198+
.. function:: isfinite(z)
199199

200-
Return ``True`` if both the real and imaginary parts of *x* are finite, and
200+
Return ``True`` if both the real and imaginary parts of *z* are finite, and
201201
``False`` otherwise.
202202

203203
.. versionadded:: 3.2
204204

205205

206-
.. function:: isinf(x)
206+
.. function:: isinf(z)
207207

208-
Return ``True`` if either the real or the imaginary part of *x* is an
208+
Return ``True`` if either the real or the imaginary part of *z* is an
209209
infinity, and ``False`` otherwise.
210210

211211

212-
.. function:: isnan(x)
212+
.. function:: isnan(z)
213213

214-
Return ``True`` if either the real or the imaginary part of *x* is a NaN,
214+
Return ``True`` if either the real or the imaginary part of *z* is a NaN,
215215
and ``False`` otherwise.
216216

217217

0 commit comments

Comments
 (0)
0