[New-bugs-announce] [issue30162] Add _PyTuple_Empty and make PyTuple_New(0) never failing

Serhiy Storchaka report at bugs.python.org
Tue Apr 25 12:51:52 EDT 2017


New submission from Serhiy Storchaka:

Proposed patch makes the empty tuple be allocated in static memory rather than dynamic memory, expose a reference to it as _PyTuple_Empty, and makes PyTuple_New(0) never raising exceptions. This allows to simplify the code. No longer need to call PyTuple_New(0), check it's result for errors, and clean up it after the use, you just can use a borrowed reference _PyTuple_Empty.

_PyTuple_Empty is for CPython internal use only.

----------
components: Interpreter Core
messages: 292274
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add _PyTuple_Empty and make PyTuple_New(0) never failing
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30162>
_______________________________________


More information about the New-bugs-announce mailing list