diff options
author | Thomas Wouters <thomas@python.org> | 2023-05-22 19:17:26 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2023-05-22 19:17:26 (GMT) |
commit | 2c4e29e32260783207568dc8581d65f0022f773a (patch) | |
tree | 8a93523a6fcef3860f4530260ee0a7d289ebdfec | |
parent | 500b0f4814e05b918f485ceebf9c7be9a52ad469 (diff) | |
parent | e295d8605699ad3d8ec46c8d55a5e47da05b20c6 (diff) | |
download | cpython-2c4e29e32260783207568dc8581d65f0022f773a.zip cpython-2c4e29e32260783207568dc8581d65f0022f773a.tar.gz cpython-2c4e29e32260783207568dc8581d65f0022f773a.tar.bz2 |
Merge branch 'main' of https://github.com/python/cpython into main
-rw-r--r-- | Doc/howto/urllib2.rst | 7 | ||||
-rw-r--r-- | Include/cpython/longintrepr.h | 5 |
2 files changed, 3 insertions, 9 deletions
diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst index 61ba6bd..86137fb 100644 --- a/Doc/howto/urllib2.rst +++ b/Doc/howto/urllib2.rst @@ -6,13 +6,6 @@ :Author: `Michael Foord <https://agileabstractions.com/>`_ -.. note:: - - There is a French translation of an earlier revision of this - HOWTO, available at `urllib2 - Le Manuel manquant - <https://web.archive.org/web/20200910051922/http://www.voidspace.org.uk/python/articles/urllib2_francais.shtml>`_. - - Introduction ============ diff --git a/Include/cpython/longintrepr.h b/Include/cpython/longintrepr.h index 0f56993..692c69b 100644 --- a/Include/cpython/longintrepr.h +++ b/Include/cpython/longintrepr.h @@ -104,9 +104,10 @@ _PyLong_FromDigits(int negative, Py_ssize_t digit_count, digit *digits); #define _PyLong_SIGN_MASK 3 #define _PyLong_NON_SIZE_BITS 3 + static inline int _PyLong_IsCompact(const PyLongObject* op) { - assert(PyLong_Check(op)); + assert(PyType_HasFeature((op)->ob_base.ob_type, Py_TPFLAGS_LONG_SUBCLASS)); return op->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS); } @@ -115,7 +116,7 @@ _PyLong_IsCompact(const PyLongObject* op) { static inline Py_ssize_t _PyLong_CompactValue(const PyLongObject *op) { - assert(PyLong_Check(op)); + assert(PyType_HasFeature((op)->ob_base.ob_type, Py_TPFLAGS_LONG_SUBCLASS)); assert(PyUnstable_Long_IsCompact(op)); Py_ssize_t sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK); return sign * (Py_ssize_t)op->long_value.ob_digit[0]; |