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 panda1200
Recipients panda1200, rhettinger, serhiy.storchaka
Date 2022-02-10.23:26:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
As you say, which implementation performs better likely depends on the nature of the sets. I would suspect that using set.difference won't be substantially faster than using set.intersection in the best case, but it would be much slower if len(self) is much larger than len(self.intersection(other)) e.g. set(range(1_000_000)).issubset(range(10)). Overall I think that using set.intersection will have more well-rounded performance.
Date User Action Args
2022-02-10 23:26:38panda1200setrecipients: + panda1200, rhettinger, serhiy.storchaka
2022-02-10 23:26:38panda1200setmessageid: <>
2022-02-10 23:26:38panda1200linkissue46705 messages
2022-02-10 23:26:38panda1200create