PyTuple_Check and other type check functions didn't check the NULL pointer

NotGuru xu.mathena at gmail.com
Mon Mar 24 00:24:03 EDT 2008


On Mar 23, 8:24 pm, Christian Heimes <li... at cheimes.de> wrote:
> NotGuru schrieb:
>
> > My questions is: is it necessary to check the null pointer in the
> > macro or it's a job for the user? Semantically all the type check
> > should report a false if a null pointer is encountered. I've already
> > had the patch to this issue but I am not sure if I think this problem
> > right.  I don't know if there are some python core developers around
> > but I would like to hear all opinions towards this.
>
> Unless stated otherwise no Py* or PY* function is NULL safe. You have to
> check for NULL unless the docs *explicitly* say it's safe to call it
> with a NULL argument.
>
> Christian

Thank you Christian and John, I skipped Section 1.3 of that document,
so shameful. ;)



More information about the Python-list mailing list