Skip to content

Commit cbebc51

Browse files
doronbeharmiss-islington
authored andcommitted
gh-141623: operator.rst: don't use term "bitwise" (GH-141846)
(cherry picked from commit bd5fa31) Co-authored-by: Doron Behar <doron.behar@gmail.com>
1 parent 6bd2e08 commit cbebc51

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

Doc/library/operator.rst

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ The mathematical and bitwise operations are the most numerous:
112112
.. function:: and_(a, b)
113113
__and__(a, b)
114114

115-
Return the bitwise and of *a* and *b*.
115+
Return ``a & b``.
116116

117117

118118
.. function:: floordiv(a, b)
@@ -136,13 +136,13 @@ The mathematical and bitwise operations are the most numerous:
136136
__inv__(obj)
137137
__invert__(obj)
138138

139-
Return the bitwise inverse of the number *obj*. This is equivalent to ``~obj``.
139+
Return ``~obj``.
140140

141141

142142
.. function:: lshift(a, b)
143143
__lshift__(a, b)
144144

145-
Return *a* shifted left by *b*.
145+
Return ``a << b``.
146146

147147

148148
.. function:: mod(a, b)
@@ -154,7 +154,7 @@ The mathematical and bitwise operations are the most numerous:
154154
.. function:: mul(a, b)
155155
__mul__(a, b)
156156

157-
Return ``a * b``, for *a* and *b* numbers.
157+
Return ``a * b``.
158158

159159

160160
.. function:: matmul(a, b)
@@ -174,25 +174,25 @@ The mathematical and bitwise operations are the most numerous:
174174
.. function:: or_(a, b)
175175
__or__(a, b)
176176

177-
Return the bitwise or of *a* and *b*.
177+
Return ``a | b``.
178178

179179

180180
.. function:: pos(obj)
181181
__pos__(obj)
182182

183-
Return *obj* positive (``+obj``).
183+
Return ``+obj``.
184184

185185

186186
.. function:: pow(a, b)
187187
__pow__(a, b)
188188

189-
Return ``a ** b``, for *a* and *b* numbers.
189+
Return ``a ** b``.
190190

191191

192192
.. function:: rshift(a, b)
193193
__rshift__(a, b)
194194

195-
Return *a* shifted right by *b*.
195+
Return ``a >> b``.
196196

197197

198198
.. function:: sub(a, b)
@@ -211,7 +211,7 @@ The mathematical and bitwise operations are the most numerous:
211211
.. function:: xor(a, b)
212212
__xor__(a, b)
213213

214-
Return the bitwise exclusive or of *a* and *b*.
214+
Return ``a ^ b``.
215215

216216

217217
Operations which work with sequences (some of them with mappings too) include:
@@ -405,13 +405,18 @@ Python syntax and the functions in the :mod:`!operator` module.
405405
+-----------------------+-------------------------+---------------------------------------+
406406
| Division | ``a // b`` | ``floordiv(a, b)`` |
407407
+-----------------------+-------------------------+---------------------------------------+
408-
| Bitwise And | ``a & b`` | ``and_(a, b)`` |
408+
| Bitwise And, or | ``a & b`` | ``and_(a, b)`` |
409+
| Intersection | | |
409410
+-----------------------+-------------------------+---------------------------------------+
410-
| Bitwise Exclusive Or | ``a ^ b`` | ``xor(a, b)`` |
411+
| Bitwise Exclusive Or, | ``a ^ b`` | ``xor(a, b)`` |
412+
| or Symmetric | | |
413+
| Difference | | |
411414
+-----------------------+-------------------------+---------------------------------------+
412-
| Bitwise Inversion | ``~ a`` | ``invert(a)`` |
415+
| Bitwise Inversion, or | ``~ a`` | ``invert(a)`` |
416+
| Complement | | |
413417
+-----------------------+-------------------------+---------------------------------------+
414-
| Bitwise Or | ``a | b`` | ``or_(a, b)`` |
418+
| Bitwise Or, or | ``a | b`` | ``or_(a, b)`` |
419+
| Union | | |
415420
+-----------------------+-------------------------+---------------------------------------+
416421
| Exponentiation | ``a ** b`` | ``pow(a, b)`` |
417422
+-----------------------+-------------------------+---------------------------------------+

0 commit comments

Comments
 (0)