Author serhiy.storchaka
Recipients donkopotamus, fdrake, pitrou, rhettinger, serhiy.storchaka, stutzbach
Date 2017-04-19.11:48:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492602507.74.0.326267243134.issue30100@psf.upfronthosting.co.za>
In-reply-to
Content
The argument for not raising TypeError for unsupported types:

This is just from the definition of a set. If the set can't contain the value of specific type, then checking if this value is contained in the set should return False, and discarding it from the set should be no-op.

The argument for raising TypeError for unsupported types:

Using a value of unsuitable type is likely a programming error. Silencing TypeError can hide an error. Since raising and catching an exception is costly (but it is cheaper in C than in Python), this also can lead to performance degradation which is hard to catch.

If the first argument is stronger then the second argument then we should change a number of set, dict, dict views and OrderedDict methods and make them returning a reasonable result rather than raising TypeError.

If the second argument is stronger then the first argument then we should change just WeakSet.__contains__() and dict.pop(). Since this is a behavior change that can break third-party code they should first emit deprecation warnings for one or two releases.
History
Date User Action Args
2017-04-19 11:48:27serhiy.storchakasetrecipients: + serhiy.storchaka, fdrake, rhettinger, pitrou, stutzbach, donkopotamus
2017-04-19 11:48:27serhiy.storchakasetmessageid: <1492602507.74.0.326267243134.issue30100@psf.upfronthosting.co.za>
2017-04-19 11:48:27serhiy.storchakalinkissue30100 messages
2017-04-19 11:48:27serhiy.storchakacreate