8000 bpo-27961: Remove leftovers from the times when long long wasn't requ… · python/cpython@a38e9d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit a38e9d1

Browse files
sir-sigurdpablogsal
authored andcommitted
bpo-27961: Remove leftovers from the times when long long wasn't required (GH-15388)
1 parent c4106af commit a38e9d1

File tree

5 files changed

+26
-38
lines changed

5 files changed

+26
-38
lines changed

Doc/library/array.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ defined:
3636
+-----------+--------------------+-------------------+-----------------------+-------+
3737
| ``'L'`` | unsigned long | int | 4 | |
3838
+-----------+--------------------+-------------------+-----------------------+-------+
39-
| ``'q'`` | signed long long | int | 8 | \(2) |
39+
| ``'q'`` | signed long long | int | 8 | |
4040
+-----------+--------------------+-------------------+-----------------------+-------+
41-
| ``'Q'`` | unsigned long long | int | 8 | \(2) |
41+
| ``'Q'`` | unsigned long long | int | 8 | |
4242
+-----------+--------------------+-------------------+-----------------------+-------+
4343
| ``'f'`` | float | float | 4 | |
4444
+-----------+--------------------+-------------------+-----------------------+-------+
@@ -57,13 +57,6 @@ Notes:
5757

5858
.. deprecated-removed:: 3.3 4.0
5959

60-
(2)
61-
The ``'q'`` and ``'Q'`` type codes are available only if
62-
the platform C compiler used to build Python supports C :c:type:`long long`,
63-
or, on Windows, :c:type:`__int64`.
64-
65-
.. versionadded:: 3.3
66-
6760
The actual representation of values is determined by the machine architecture
6861
(strictly speaking, by the C implementation). The actual size can be accessed
6962
through the :attr:`itemsize` attribute.

Doc/library/posix.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ by defining the relevant size and offset types as 64-bit values. Such files are
4444
sometimes referred to as :dfn:`large files`.
4545

4646
Large file support is enabled in Python when the size of an :c:type:`off_t` is
47-
larger than a :c:type:`long` and the :c:type:`long long` type is available and is
48-
at least as large as an :c:type:`off_t`.
47+
larger than a :c:type:`long` and the :c:type:`long long` is at least as large
48+
as an :c:type:`off_t`.
4949
It may be necessary to configure and compile Python with certain compiler flags
5050
to enable this mode. For example, it is enabled by default with recent versions
5151
of Irix, but with Solaris 2.6 and 2.7 you need to do something like::

Doc/library/struct.rst

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -197,44 +197,44 @@ platform-dependent.
197197
+--------+--------------------------+--------------------+----------------+------------+
198198
| ``c`` | :c:type:`char` | bytes of length 1 | 1 | |
199199
+--------+--------------------------+--------------------+----------------+------------+
200-
| ``b`` | :c:type:`signed char` | integer | 1 | \(1),\(3) |
200+
| ``b`` | :c:type:`signed char` | integer | 1 | \(1), \(2) |
201201
+--------+--------------------------+--------------------+----------------+------------+
202-
| ``B`` | :c:type:`unsigned char` | integer | 1 | \(3) |
202+
| ``B`` | :c:type:`unsigned char` | integer | 1 | \(2) |
203203
+--------+--------------------------+--------------------+----------------+------------+
204204
| ``?`` | :c:type:`_Bool` | bool | 1 | \(1) |
205205
+--------+--------------------------+--------------------+----------------+------------+
206-
| ``h`` | :c:type:`short` | integer | 2 | \(3) |
206+
| ``h`` | :c:type:`short` | integer | 2 | \(2) |
207207
+--------+--------------------------+--------------------+----------------+------------+
208-
| ``H`` | :c:type:`unsigned short` | integer | 2 | \(3) |
208+
| ``H`` | :c:type:`unsigned short` | integer | 2 | \(2) |
209209
+--------+--------------------------+--------------------+----------------+------------+
210-
| ``i`` | :c:type:`int` | integer | 4 | \(3) |
210+
| ``i`` | :c:type:`int` | integer | 4 | \(2) |
211211
+--------+--------------------------+--------------------+----------------+------------+
212-
| ``I`` | :c:type:`unsigned int` | integer | 4 | \(3) |
212+
| ``I`` | :c:type:`unsigned int` | integer | 4 | \(2) |
213213
+--------+--------------------------+--------------------+----------------+------------+
214-
| ``l`` | :c:type:`long` | integer | 4 | \(3) |
214+
| ``l`` | :c:type:`long` | integer | 4 | \(2) |
215215
+--------+--------------------------+--------------------+----------------+------------+
216-
| ``L`` | :c:type:`unsigned long` | integer | 4 | \(3) |
216+
| ``L`` | :c:type:`unsigned long` | integer | 4 | \(2) |
217217
+--------+--------------------------+--------------------+----------------+------------+
218-
| ``q`` | :c:type:`long long` | integer | 8 | \(2), \(3) |
218+
| ``q`` | :c:type:`long long` | integer | 8 | \(2) |
219219
+--------+--------------------------+--------------------+----------------+------------+
220-
| ``Q`` | :c:type:`unsigned long | integer | 8 | \(2), \(3) |
220+
| ``Q`` | :c:type:`unsigned long | integer | 8 | \(2) |
221221
| | long` | | | |
222222
+--------+--------------------------+--------------------+----------------+------------+
223-
| ``n`` | :c:type:`ssize_t` | integer | | \(4) |
223+
| ``n`` | :c:type:`ssize_t` | integer | | \(3) |
224224
+--------+--------------------------+--------------------+----------------+------------+
225-
| ``N`` | :c:type:`size_t` | integer | | \(4) |
225+
| ``N`` | :c:type:`size_t` | integer | | \(3) |
226226
+--------+--------------------------+--------------------+----------------+------------+
227-
| ``e`` | \(7) | float | 2 | \(5) |
227+
| ``e`` | \(6) | float | 2 | \(4) |
228228
+--------+--------------------------+--------------------+----------------+------------+
229-
| ``f`` | :c:type:`float` | float | 4 | \(5) |
229+
| ``f`` | :c:type:`float` | float | 4 | \(4) |
230230
+--------+--------------------------+--------------------+----------------+------------+
231-
| ``d`` | :c:type:`double` | float | 8 | \(5) |
231+
| ``d`` | :c:type:`double` | float | 8 | \(4) |
232232
+--------+--------------------------+--------------------+----------------+------------+
233233
| ``s`` | :c:type:`char[]` | bytes | | |
234234
+--------+--------------------------+--------------------+----------------+------------+
235235
| ``p`` | :c:type:`char[]` | bytes | | |
236236
+--------+--------------------------+--------------------+----------------+------------+
237-
| ``P`` | :c:type:`void \*` | integer | | \(6) |
237+
| ``P`` | :c:type:`void \*` | integer | | \(5) |
238238
+--------+--------------------------+--------------------+----------------+------------+
239239

240240
.. versionchanged:: 3.3
@@ -254,38 +254,33 @@ Notes:
254254
standard mode, it is always represented by one byte.
255255

256256
(2)
257-
The ``'q'`` and ``'Q'`` conversion codes are available in native mode only if
258-
the platform C compiler supports C :c:type:`long long`, or, on Windows,
259-
:c:type:`__int64`. They are always available in standard modes.
260-
261-
(3)
262257
When attempting to pack a non-integer using any of the integer conversion
263258
codes, if the non-integer has a :meth:`__index__` method then that method is
264259
called to convert the argument to an integer before packing.
265260

266261
.. versionchanged:: 3.2
267262
Use of the :meth:`__index__` method for non-integers is new in 3.2.
268263

269-
(4)
264+
(3)
270265
The ``'n'`` and ``'N'`` conversion codes are only available for the native
271266
size (selected as the default or with the ``'@'`` byte order character).
272267
For the standard size, you can use whichever of the other integer formats
273268
fits your application.
274269

275-
(5)
270+
(4)
276271
For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed
277272
representation uses the IEEE 754 binary32, binary64 or binary16 format (for
278273
``'f'``, ``'d'`` or ``'e'`` respectively), regardless of the floating-point
279274
format used by the platform.
280275

281-
(6)
276+
(5)
282277
The ``'P'`` format character is only available for the native byte ordering
283278
(selected as the default or with the ``'@'`` byte order character). The byte
284279
order character ``'='`` chooses to use little- or big-endian ordering based
285280
on the host system. The struct module does not interpret this as native
286281
ordering, so the ``'P'`` format is not available.
287282

288-
(7)
283+
(6)
289284
The IEEE 754 binary16 "half precision" type was introduced in the 2008
290285
revision of the `IEEE 754 standard <ieee 754 standard_>`_. It has a sign
291286
bit, a 5-bit exponent and 11-bit precision (with 10 bits explicitly stored),

PC/pyconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
295295
# define SIZEOF_FPOS_T 8
296296
# define SIZEOF_HKEY 8
297297
# define SIZEOF_SIZE_T 8
298-
/* configure.ac defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG,
298+
/* configure.ac defines HAVE_LARGEFILE_SUPPORT iff
299299
sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t).
300300
On Win64 the second condition is not true, but if fpos_t replaces off_t
301301
then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64

pyconfig.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@
569569
#undef HAVE_LANGINFO_H
570570

571571
/* Defined to enable large file support when an off_t is bigger than a long
572-
and long long is available and at least as big as an off_t. You may need to
572+
and long long is at least as big as an off_t. You may need to
573573
add some flags for configuration and compilation to enable this mode. (For
574574
Solaris and Linux, the necessary defines are already defined.) */
575575
#undef HAVE_LARGEFILE_SUPPORT

0 commit comments

Comments
 (0)
0