[issue4258] Use 30-bit digits instead of 15-bit digits for Python integers. - Code Review (original) (raw)

OLD

NEW

1

1

2 :mod:`sys` --- System-specific parameters and functions

2 :mod:`sys` --- System-specific parameters and functions

3 =======================================================

3 =======================================================

4

4

5 .. module:: sys

5 .. module:: sys

6 :synopsis: Access system-specific parameters and functions.

6 :synopsis: Access system-specific parameters and functions.

7

7

8

8

9 This module provides access to some variables used or maintained by the

9 This module provides access to some variables used or maintained by the

10 interpreter and to functions that interact strongly with the interpreter. It is

10 interpreter and to functions that interact strongly with the interpreter. It is

(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading...

406 else:

406 else:

407 # use an alternative implementation or warn the user

407 # use an alternative implementation or warn the user

408 ...

408 ...

409

409

410 This is called ``hexversion`` since it only really looks meaningful when view ed

410 This is called ``hexversion`` since it only really looks meaningful when view ed

411 as the result of passing it to the built-in :func:`hex` function. The

411 as the result of passing it to the built-in :func:`hex` function. The

412 ``version_info`` value may be used for a more human-friendly encoding of the

412 ``version_info`` value may be used for a more human-friendly encoding of the

413 same information.

413 same information.

414

414

415

415

416 .. data:: int_info

417

418 A struct sequence that holds information about Python's

419 internal representation of integers. The attributes are read only.

420

421 +-------------------------+----------------------------------------------+

422 | attribute | explanation |

423 +=========================+==============================================+

424 | :const:`bits_per_digit` | number of bits held in each digit. Python |

425 | | integers are stored internally in base |

426 | | ``2**int_info.bits_per_digit`` |

427 +-------------------------+----------------------------------------------+

428 | :const:`sizeof_digit` | size in bytes of the C type used to |

429 | | represent a digit |

430 +-------------------------+----------------------------------------------+

431

432

416 .. function:: intern(string)

433 .. function:: intern(string)

417

434

418 Enter *string* in the table of "interned" strings and return the interned str ing

435 Enter *string* in the table of "interned" strings and return the interned str ing

419 -- which is *string* itself or a copy. Interning strings is useful to gain a

436 -- which is *string* itself or a copy. Interning strings is useful to gain a

420 little performance on dictionary lookup -- if the keys in a dictionary are

437 little performance on dictionary lookup -- if the keys in a dictionary are

421 interned, and the lookup key is interned, the key comparisons (after hashing)

438 interned, and the lookup key is interned, the key comparisons (after hashing)

422 can be done by a pointer compare instead of a string compare. Normally, the

439 can be done by a pointer compare instead of a string compare. Normally, the

423 names used in Python programs are automatically interned, and the dictionarie s

440 names used in Python programs are automatically interned, and the dictionarie s

424 used to hold module, class or instance attributes have interned keys.

441 used to hold module, class or instance attributes have interned keys.

425

442

(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading...

783 framework.

800 framework.

784

801

785

802

786 .. data:: winver

803 .. data:: winver

787

804

788 The version number used to form registry keys on Windows platforms. This is

805 The version number used to form registry keys on Windows platforms. This is

789 stored as string resource 1000 in the Python DLL. The value is normally the

806 stored as string resource 1000 in the Python DLL. The value is normally the

790 first three characters of :const:`version`. It is provided in the :mod:`sys`

807 first three characters of :const:`version`. It is provided in the :mod:`sys`

791 module for informational purposes; modifying this value has no effect on the

808 module for informational purposes; modifying this value has no effect on the

792 registry keys used by Python. Availability: Windows.

809 registry keys used by Python. Availability: Windows.

OLD

NEW