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 brechtm
Recipients brechtm
Date 2014-11-15.22:47:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1416091669.05.0.557383072226.issue22879@psf.upfronthosting.co.za>
In-reply-to
Content
set's add() method would be a little bit more useful if it would return True if the added value was already present in the set, and False if it wasn't (or the other way around). Similarly, discard() could report whether the discarded value was present in the set or not.

I suppose this could cost a couple of extra cycles and I'm not sure this is acceptable. For discard() there's always remove() that offers similar behavior. add() does not have an alternative that offers check-and-add behavior.
History
Date User Action Args
2014-11-15 22:47:49brechtmsetrecipients: + brechtm
2014-11-15 22:47:49brechtmsetmessageid: <1416091669.05.0.557383072226.issue22879@psf.upfronthosting.co.za>
2014-11-15 22:47:48brechtmlinkissue22879 messages
2014-11-15 22:47:48brechtmcreate