On 3/23/2020 5:49 AM, Guido van Rossum wrote:
On Sun, Mar 22, 2020 at 6:51 PM Steven D'Aprano <steve@pearwood.info mailto:steve@pearwood.info> wrote:
We might have a terminology issue here, since according to Wikipedia there is some dispute over whether or not to include the equality case in subset/superset: https://en.wikipedia.org/wiki/Subset For what it is worth, I'm in the school that subset implies proper subset [...]
Wikipedia's pedantry notwithstanding, I don't think this is a useful position *when talking about Python sets*, since Python's set's .issubset() method returns True when the argument is the same set:
{1}.issubset({1})
True
Or did I miss a wink?
The Python way is the mathematically correct way of interpreting the terms "subset" and "superset".
Note that the discussion Steven referred to targets the symbol to be used, ie. whether "⊂" (proper subset) should mean the same as "⊆" (subset or equal). As with everything in math, such details are always defined via definitions in the respective paper or book. This can be confusing for the casual reader, but it's not "right" or "wrong".
Personally, I find the analogy to "<" vs. "≤" very reasonable, but that still doesn't imply anything wrong with Python, since the "proper subset" property would naturally be called ".ispropersubsect()" :-)