A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-July/026942.html below:

[Python-Dev] PEP 296 - The Buffer Problem

[Python-Dev] PEP 296 - The Buffer Problem [Python-Dev] PEP 296 - The Buffer ProblemTim Peters tim.one@comcast.net
Thu, 25 Jul 2002 15:51:44 -0400
[Scott Gilbert]
> ...
> How would you designate failure/exceptions?  size_t is unsigned everywhere
> I can find it,

Right, and the std requires that size_t resolve to an unsigned type, so
that's reliable.

> so it can't return a negative number on failure.

The usual dodge is to return (and test against)

    (size_t)-1

in that case.  If the caller sees that the result is (size_t)-1, then it
also needs to call PyErr_Occurred() to see whether it's a normal, or error,
return value (and if it is an error case, the routine had to have set a
Python exception, so that PyErr_Occurred() returns true then).

> I guess the void** could be filled in with NULL.

Sounds easier to me <wink>.




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4