@@ -129,9 +129,8 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
129
129
single: OverflowError (built-in exception)
130
130
131
131
Return a C :c:type:`long` representation of *obj*. If *obj* is not an
132
- instance of :c:type:`PyLongObject`, first call its :meth:`__index__` or
133
- :meth:`__int__` method (if present) to convert it to a
134
- :c:type:`PyLongObject`.
132
+ instance of :c:type:`PyLongObject`, first call its :meth:`__index__` method
133
+ (if present) to convert it to a :c:type:`PyLongObject`.
135
134
136
135
Raise :exc:`OverflowError` if the value of *obj* is out of range for a
137
136
:c:type:`long`.
@@ -141,16 +140,15 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
141
140
.. versionchanged:: 3.8
142
141
Use :meth:`__index__` if available.
143
142
144
- .. deprecated :: 3.8
145
- Using :meth:`__int__` is deprecated .
143
+ .. versionchanged :: 3.10
144
+ This function will no longer use :meth:`__int__`.
146
145
147
146
148
147
.. c:function:: long PyLong_AsLongAndOverflow(PyObject *obj, int *overflow)
149
148
150
149
Return a C :c:type: `long ` representation of *obj *. If *obj * is not an
151
- instance of :c:type: `PyLongObject `, first call its :meth: `__index__ ` or
152
- :meth: `__int__ ` method (if present) to convert it to a
153
- :c:type:`PyLongObject`.
150
+ instance of :c:type: `PyLongObject `, first call its :meth: `__index__ `
151
+ method (if present) to convert it to a :c:type:`PyLongObject`.
154
152
155
153
If the value of *obj* is greater than :const :`LONG_MAX` or less than
156
154
:const :`LONG_MIN`, set *\*overflow* to ``1`` or ``-1``, respectively, and
@@ -162,8 +160,8 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
162
160
.. versionchanged :: 3.8
163
161
Use :meth: `__index__ ` if available.
164
162
165
- .. deprecated :: 3.8
166
- Using :meth: `__int__ ` is deprecated .
163
+ .. versionchanged :: 3.10
164
+ This function will no longer use :meth: `__int__ `.
167
165
168
166
169
167
.. c :function :: long long PyLong_AsLongLong (PyObject *obj)
@@ -172,9 +170,8 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
172
170
single: OverflowError (built-in exception)
173
171
174
172
Return a C :c:type:`long long` representation of *obj*. If *obj* is not an
175
- instance of :c:type:`PyLongObject`, first call its :meth:`__index__` or
176
- :meth:`__int__` method (if present) to convert it to a
177
- :c:type:`PyLongObject`.
173
+ instance of :c:type:`PyLongObject`, first call its :meth:`__index__` method
174
+ (if present) to convert it to a :c:type:`PyLongObject`.
178
175
179
176
Raise :exc:`OverflowError` if the value of *obj* is out of range for a
180
177
:c:type:`long long`.
@@ -184,16 +181,15 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
184
181
.. versionchanged:: 3.8
185
182
Use :meth:`__index__` if available.
186
183
187
- .. deprecated :: 3.8
188
- Using :meth:`__int__` is deprecated .
184
+ .. versionchanged :: 3.10
185
+ This function will no longer use :meth:`__int__`.
189
186
190
187
191
188
.. c:function:: long long PyLong_AsLongLongAndOverflow(PyObject *obj, int *overflow)
192
189
193
190
Return a C :c:type: `long long ` representation of *obj *. If *obj * is not an
194
- instance of :c:type: `PyLongObject `, first call its :meth: `__index__ ` or
195
- :meth: `__int__ ` method (if present) to convert it to a
196
- :c:type:`PyLongObject`.
191
+ instance of :c:type: `PyLongObject `, first call its :meth: `__index__ ` method
192
+ (if present) to convert it to a :c:type:`PyLongObject`.
197
193
198
194
If the value of *obj* is greater than :const :`LLONG_MAX` or less than
199
195
:const :`LLONG_MIN`, set *\*overflow* to ``1`` or ``-1``, respectively,
@@ -207,8 +203,8 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
207
203
.. versionchanged :: 3.8
208
204
Use :meth: `__index__ ` if available.
209
205
210
- .. deprecated :: 3.8
211
- Using :meth: `__int__ ` is deprecated .
206
+ .. versionchanged :: 3.10
207
+ This function will no longer use :meth: `__int__ `.
212
208
213
209
214
210
.. c :function :: Py_ssize_t PyLong_AsSsize_t (PyObject *pylong)
@@ -278,10 +274,9 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
278
274
279
275
.. c:function:: unsigned long PyLong_AsUnsignedLongMask(PyObject *obj)
280
276
281
- Return a C :c:type: `unsigned long ` representation of *obj *. If *obj *
282
- is not an instance of :c:type: `PyLongObject `, first call its
283
- :meth: `__index__ ` or :meth: `__int__ ` method (if present) to convert
284
- it to a :c:type:`PyLongObject`.
277
+ Return a C :c:type: `unsigned long ` representation of *obj *. If *obj * is not
278
+ an instance of :c:type: `PyLongObject `, first call its :meth: `__index__ `
279
+ method (if present) to convert it to a :c:type:`PyLongObject`.
285
280
286
281
If the value of *obj* is out of range for an :c:type:`unsigned long`,
287
282
return the reduction of that value modulo ``ULONG_MAX + 1``.
@@ -292,16 +287,16 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
292
287
.. versionchanged:: 3.8
293
288
Use :meth:`__index__` if available.
294
289
295
- .. deprecated :: 3.8
296
- Using :meth:`__int__` is deprecated .
290
+ .. versionchanged :: 3.10
291
+ This function will no longer use :meth:`__int__`.
297
292
298
293
299
294
.. c:function:: unsigned long long PyLong_AsUnsignedLongLongMask(PyObject *obj)
300
295
301
296
Return a C :c:type: `unsigned long long ` representation of *obj *. If *obj *
302
297
is not an instance of :c:type: `PyLongObject `, first call its
303
- :meth: `__index__ ` or :meth: ` __int__ ` method (if present) to convert
304
- it to a :c:type:`PyLongObject`.
298
+ :meth: `__index__ ` method (if present) to convert it to a
299
+ :c:type:`PyLongObject`.
305
300
306
301
If the value of *obj* is out of range for an :c:type:`unsigned long long`,
307
302
return the reduction of that value modulo ``ULLONG_MAX + 1``.
@@ -312,8 +307,8 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
312
307
.. versionchanged:: 3.8
313
308
Use :meth:`__index__` if available.
314
309
315
- .. deprecated :: 3.8
316
- Using :meth:`__int__` is deprecated .
310
+ .. versionchanged :: 3.10
311
+ This function will no longer use :meth:`__int__`.
317
312
318
313
319
314
.. c:function:: double PyLong_AsDouble(PyObject *pylong)
0 commit comments