[docs] [issue19362] Documentation for len() fails to mention that it works on sets

Terry J. Reedy report at bugs.python.org
Tue Feb 4 22:26:05 CET 2014


Terry J. Reedy added the comment:

My objection to 'container' is that it is inaccurate and leads to inaccurate mental models. A set is like a non-exclusive club or association, defined either by rule or roster, not like a box or room, which contain exclusively. I am 'in' the set Python Developers, but am not contained by it.

Some decades ago I was hindered by the notion that a set is like a box (container). A web search indicates that the top hits all have variations on 'well-defined, unordered *collection* of objects, considered as an object in itself' -- wikipedia, mathisfun, wikia, brittanica, math.ku.edu.  We do a disservice to call a set a container.

It is true that many Python collections are implemented by containing references to objects (a roster) but ranges are not (a parameterized rule). The *collections* module is properly named.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19362>
_______________________________________


More information about the docs mailing list