[Python-Dev] Adding insint() function (original) (raw)
Vladimir Marangozov Vladimir.Marangozov@inrialpes.fr
Fri, 18 Aug 2000 20:17:53 +0200 (CEST)
- Previous message: [Python-Dev] Adding insint() function
- Next message: [Python-Dev] Adding insint() function
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Andrew Kuchling wrote:
On Fri, Aug 18, 2000 at 01:52:20PM -0400, Tim Peters wrote: >+1, provided the treatment of errors is clearly documented. The treatment of errors in module init functions seems to be simply charge ahead and do the inserts, and then do 'if (PyErrOccurred()) PyFatalError())'. The new function will probably return NULL if there's an error, but I doubt anyone will check it; it's too ungainly to write if ( (PyDictSetItemStringInt(d, "foo", FOO)) == NULL || (PyDictSetItemStringInt(d, "bar", BAR)) == NULL || ... repeat for 187 more constants ...
:-)
So name it PyModule_AddConstant(module, name, constant), which fails with "can't add constant to module" err msg.
-- Vladimir MARANGOZOV | Vladimir.Marangozov@inrialpes.fr http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252
- Previous message: [Python-Dev] Adding insint() function
- Next message: [Python-Dev] Adding insint() function
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]