[Python-checkins] devguide: Document special case of PyLong_FromLong() for n [-5 ... +255]

christian.heimes python-checkins at python.org
Fri Jul 26 18:34:17 CEST 2013


http://hg.python.org/devguide/rev/b36dc969c0d2
changeset:   632:b36dc969c0d2
user:        Christian Heimes <christian at cheimes.de>
date:        Fri Jul 26 18:34:09 2013 +0200
summary:
  Document special case of PyLong_FromLong() for n [-5 ... +255]

files:
  coverity.rst |  6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/coverity.rst b/coverity.rst
--- a/coverity.rst
+++ b/coverity.rst
@@ -57,11 +57,15 @@
   without touching its reference count. On this ground the analyzer detects
   a resource leak. CID 719685
 
-``PyLong_FromLong(-1)``
+``PyLong_FromLong()`` for negative values
   Coverity claims that ``PyLong_FromLong()`` and other ``PyLong_From*()``
   functions cannot handle a negative value because the value might be used as
   an array index in ``get_small_int()``. CID 486783
 
+``PyLong_FromLong()`` for n in [-5 ... +255]
+  For integers in the range of Python's small int cache the ``PyLong_From*()``
+  function can never fail and never returns NULL. CID 1058291
+
 ``PyArg_ParseTupleAndKeywords(args, kwargs, "s#", &data, &length)``
   Some functions use the format char combination such as ``s#``, ``u#`` or
   ``z#`` to get data and length of a character array. Coverity doesn't

-- 
Repository URL: http://hg.python.org/devguide


More information about the Python-checkins mailing list