On Sun, 22 Mar 2020 at 20:01, Steve Jorgensen <[email protected]> wrote:
>
> Currently, the `issubset` and `issuperset` methods of set objects accept 
> arbitrary iterables as arguments. An iterable that is both a subset and 
> superset is, in a sense, "equal" to the set. It would be inappropriate for 
> `==` to return `True` for such a comparison, however, since that would break 
> the `Hashable` contract.
>
> Should sets have an additional method, something like `like(other)`, 
> `issimilar(other)`, or `isequivalent(other)`, that returns `True` for any 
> iterable that contains the all of the items in the set and no items that are 
> not in the set? It would therefore be true in the same cases where `<set> = 
> set(other)` or `<set>.issubset(other) and <set>.issuperset(other)` is true.

What is the practical use case for this? It seems like it would be a
pretty rare need, at best.
Paul
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/OJKLFPGZWL2MN5AZJOA6GAYCG32COIX6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to