[Python-Dev] Improving docs for len() of set

Ben Hoyt benhoyt at gmail.com
Mon Feb 8 11:23:47 EST 2016


Hi folks,

Just a suggestion for a documentation tweak. Currently the docs for len()
on a set say this:

   .. describe:: len(s)

      Return the cardinality of set *s*.

I'm a relatively seasoned programmer, but I don't really have a maths
background, and I didn't know what "cardinality" meant. I could kind of
grok it by context, but could we change this to something like the
following?

   .. describe:: len(s)

      Return the number of elements in set *s* (cardinality of *s*).

Happy to open a bugs.python.org issue on this, but wanted to get general
consensus first.

-Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160208/ea2b7e9c/attachment.html>


More information about the Python-Dev mailing list