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
@Ben I am not either a great fan of formal (mathematic) definitions (: Lorenzo Moriondo, from mobile ~~it.linkedin.com~in~lorenzomoriondo~~ On Feb 8, 2016 5:38 PM, "Ethan Furman" <ethan@stoneleaf.us> wrote:
On 02/08/2016 08:23 AM, Ben Hoyt wrote:
.. describe:: len(s)
Return the number of elements in set *s* (cardinality of *s*).
Return the number of elements (cardinality) of *s*.
+1
+1 to this for me as well
-- ~Ethan~ _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:
https://mail.python.org/mailman/options/python-dev/tunedconsulting%40gmail.c...
On Monday, February 8, 2016 8:23 AM, Ben Hoyt <benhoyt@gmail.com> wrote:
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*).
+{{}} (using the normal von Neumann definitions for 0={} and Succ(n) = n U {n})
On Mon, Feb 8, 2016 at 8:24 AM Ben Hoyt <benhoyt@gmail.com> wrote:
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*).
Agreed. Done. :) -gps
Thanks! Commit ref: https://hg.python.org/cpython/rev/a67fda8e33b0 -Ben On Mon, Feb 8, 2016 at 1:00 PM, Gregory P. Smith <greg@krypto.org> wrote:
On Mon, Feb 8, 2016 at 8:24 AM Ben Hoyt <benhoyt@gmail.com> wrote:
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*).
Agreed. Done. :)
-gps
participants (5)
-
Andrew Barnert
-
Ben Hoyt
-
Ethan Furman
-
Gregory P. Smith
-
Lorenzo Moriondo