[docs] missing info for the documentation of set.add()

Sandro Tosi sandro.tosi at gmail.com
Sat Aug 20 01:34:44 CEST 2011


Hello Ioannis,
thanks for your email.

On Tue, Apr 12, 2011 at 17:09, Ioannis Tziakos <mail at itziakos.gr> wrote:
> Hi All,
>
> I have noticed that there is a difference in the current documentation for
> python 2.7.1 and
> the doc-string of set.add().
>
> The documentation (http://docs.python.org/library/stdtypes.html#set) reads
>
> --------
> add(elem)
>        Add element elem to the set.
> --------
>
>
> While python 2.7.1 doc string provides additional info
>
> --------
> Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "copyright", "credits" or "license()" for more information.
>>>>
>>>> help(set.add)
>
> Help on method_descriptor:
>
> add(...)
>      Add an element to a set.
>
>      This has no effect if the element is already present.
>
>>>>
> --------

In mathematics, adding an element to a set that it's already in it, is
a "no-op" , and the same in Python. I don't the small difference
between the docstring (more explicit) and the documentation (that
simply reflect the math behavior) needs any change.

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


More information about the docs mailing list