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 stutzbach
Recipients daniel.urban, eric.araujo, rhettinger, stutzbach, terry.reedy
Date 2010-08-20.21:35:25
SpamBayes Score 5.84134e-07
Marked as misclassified No
Message-id <>
Thank you for the patch.

We should only iterate over the shorter set if the longer set is really a set and not just a sequence.  PySequence_Contains may take O(n) time on a list, making the algorithm an expensive O(n**2) overall.  I note that set_isdisjoint doesn't try to examine the lengths.

Also, since PyIter_Next returns NULL to indicate the end of the iteration OR to indicate an exception, the end of the function should look like this:

    if (PyErr_Occurred())
        return NULL;

Other than those two issues, the patch looks good to me.
Date User Action Args
2010-08-20 21:35:27stutzbachsetrecipients: + stutzbach, rhettinger, terry.reedy, eric.araujo, daniel.urban
2010-08-20 21:35:27stutzbachsetmessageid: <>
2010-08-20 21:35:26stutzbachlinkissue9212 messages
2010-08-20 21:35:25stutzbachcreate