[issue34397] remove redundant overflow checks in tuple and list implementations

Sergey Fedoseev report at bugs.python.org
Mon Aug 13 15:38:54 EDT 2018


New submission from Sergey Fedoseev <fedoseev.sergey at gmail.com>:

Max size of list and tuples is limited by PY_SSIZE_T_MAX / sizeof(PyObject*), so the sum of any two list/tuples sizes always <= PY_SSIZE_T_MAX if sizeof(PyObject*) > 1, which seems true for all supported (existing?) platforms.
It means that overflow checks in app1, ins1, list_concat and tupleconcat are redundant and can be safely removed.

----------
components: Interpreter Core
messages: 323491
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: remove redundant overflow checks in tuple and list implementations
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34397>
_______________________________________


More information about the Python-bugs-list mailing list