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.

Title: The result of set_copy() is not checked for NULL
Type: performance Stage:
Components: None Versions: Python 2.5.3
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: CWRU_Researcher1, mark.dickinson, rhettinger
Priority: normal Keywords:

Created on 2008-11-29 17:12 by CWRU_Researcher1, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg76606 - (view) Author: Brian Szuter (CWRU_Researcher1) Date: 2008-11-29 17:12
Line 1204

The result of set_copy() is not checked for NULL.

[See Objects/setobject.c(set_difference) for example of correct usage]
msg76608 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-11-29 17:31
I believe the code is correct as it is.  The relevant lines are in

	if ((PyObject *)so == other)
		return set_copy(so);

If the result of the set_copy is NULL then the NULL is passed directly 
back to the calling routine;  this is as it should be.  A NULL coming from 
set_copy indicates that an exception occurred; this is then passed on to 
the calling routine so that the calling routine is aware of the exception.

If you haven't already done so, please take a look at

especially the section on exception handling.
msg76610 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-11-29 17:37
The code is correct as-is.
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48715
2008-11-29 17:37:51rhettingersetnosy: + rhettinger
messages: + msg76610
2008-11-29 17:31:09mark.dickinsonsetstatus: open -> closed
resolution: not a bug
messages: + msg76608
nosy: + mark.dickinson
2008-11-29 17:12:26CWRU_Researcher1create