[Python-Dev] PyTuple_Pack with NULL argument

5 views
Skip to first unread message

Lisandro Dalcin

unread,
Dec 17, 2007, 4:19:57 PM12/17/07
to Python-Dev
Currently, PyTuple_Pack() does not check for NULL arguments, so it is
going to segfault in this case. Is this intended for performance
reasons?


--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Python-Dev mailing list
Pytho...@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev2-garchive-22421%40googlegroups.com

Guido van Rossum

unread,
Dec 17, 2007, 5:58:15 PM12/17/07
to Lisandro Dalcin, Python-Dev
Yes, a tuple containing NULL should never be exposed to Python code --
it should only ever be a temporary result in C code. The C code should
ensure all tuple items are non-NULL before passing the tuple off to
Python (or even to its caller, in most cases).

--Guido

> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
>

--
--Guido van Rossum (home page: http://www.python.org/~guido/)

Reply all
Reply to author
Forward
0 new messages