python / python/cpython

set.intersection help suggests 2 sets, while any number > 0 is supported

Open
#99,967 5 comments 0 reactions 1 assignee View on GitHub

@rhettinger is already working on this.

Since Dec 3, 2022.

docs
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

set.intersection help suggests 2 sets, while any number > 0 is supported

pydoc set.intersection states:

set.intersection = intersection(...)
Return the intersection of two sets as a new set.

(i.e. all elements that are in both sets.)

while in fact one or more sets can be passed to the function, e.g.

>>> set.intersection({0,1,2,3}, {1,2,3,4}, {2,3,4,5})
{2, 3}
>>> set.intersection({0,1,2,3})
{0, 1, 2, 3}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.