This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nadeem.vawda
Recipients nadeem.vawda, pitrou
Date 2011-09-06.07:40:15
SpamBayes Score 1.6657999e-06
Marked as misclassified No
Message-id <1315294818.19.0.176172892985.issue12909@psf.upfronthosting.co.za>
In-reply-to
Content
The C functions for converting a Python 'int' object to a C integer are
inconsistent about what exception gets raised when the object passed to
them is not an integer. Most of these functions raise a TypeError, but
PyLong_AsUnsignedLongLong() and PyLong_AsDouble() raise a SystemError
instead.

Raising a SystemError here is quite unhelpful. My understanding is that
it is intended to indicate internal programming errors, so an extension
module should not raise one when (for example) a function is passed an
argument of the incorrect type. In such a case, raising a TypeError is a
reasonable default.

Is there any reason not to change the behaviour of these two functions to
be consistent with their siblings?
History
Date User Action Args
2011-09-06 07:40:18nadeem.vawdasetrecipients: + nadeem.vawda, pitrou
2011-09-06 07:40:18nadeem.vawdasetmessageid: <1315294818.19.0.176172892985.issue12909@psf.upfronthosting.co.za>
2011-09-06 07:40:15nadeem.vawdalinkissue12909 messages
2011-09-06 07:40:15nadeem.vawdacreate