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/2004-February/042576.html below:

[Python-Dev] PyDict_Size() error return

[Python-Dev] PyDict_Size() error return [Python-Dev] PyDict_Size() error returnGuido van Rossum guido at python.org
Mon Feb 16 01:06:41 EST 2004
> PyDict_Size() sets an exception and returns 0 if it is passed NULL or a
> non-dict.  Is this a bug?  It seems like it should return -1, otherwise
> you'd have to distinguish between an empty dict and an error by calling
> PyErr_Occurred().

Looks like an (old) bug to me.  All other similar cases return NULL or
-1, and some calls to PyDict_Size() actually check for < 0.  (Many
calls don't check for errors, but those probably "know" that they are
dealing with a dict and maintain that invariant in other ways.)

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

More information about the Python-Dev mailing list

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