From DXDragon at yandex.ru Mon Feb 13 17:43:47 2012 From: DXDragon at yandex.ru (=?utf-8?B?0KDQvtC80LDQvSDQlNC+0L3Rh9C10L3QutC+?=) Date: Mon, 13 Feb 2012 20:43:47 +0400 Subject: [Doc-SIG] __self__ on built-in functions Message-ID: Hello, The language reference for Python 3.2 (and the development version, as well), says this in section 3.2: ~ Built-in functions A built-in function object is a wrapper around a C function. Examples of built-in functions are len() and math.sin() (math is a standard built-in module). <...> Special read-only attributes: <...> __self__ is set to None (but see the next item) <...>. ~ Now I don't know whether it's a bug in Python or in the docs, but that doesn't seem to be the case: ActivePython 3.2.2.3 (ActiveState Software Inc.) based on Python 3.2.2 (default, Sep 8 2011, 10:55:13) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> len.__self__ >>> open.__self__ >>> import math >>> math.sin.__self__ Thoughts? Roman. From fuzzyman at voidspace.org.uk Mon Feb 13 18:40:57 2012 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 13 Feb 2012 17:40:57 +0000 Subject: [Doc-SIG] __self__ on built-in functions In-Reply-To: References: Message-ID: <4F394B29.5060703@voidspace.org.uk> On 13/02/2012 16:43, ????? ???????? wrote: > Hello, > > The language reference for Python 3.2 (and the development version, as > well), says this in section 3.2: > > ~ > Built-in functions > > A built-in function object is a wrapper around a C function. Examples > of built-in functions are len() and math.sin() (math is a standard > built-in module). <...> Special read-only attributes: <...> __self__ > is set to None (but see the next item) <...>. > ~ > > Now I don't know whether it's a bug in Python or in the docs, but that > doesn't seem to be the case: > > ActivePython 3.2.2.3 (ActiveState Software Inc.) based on > Python 3.2.2 (default, Sep 8 2011, 10:55:13) [MSC v.1500 64 bit > (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. >>>> len.__self__ > >>>> open.__self__ > >>>> import math >>>> math.sin.__self__ > > > Thoughts? > Yep, that seems like a documentation bug. Please file an issue for it. All the best, Michael > Roman. > > _______________________________________________ > Doc-SIG maillist - Doc-SIG at python.org > http://mail.python.org/mailman/listinfo/doc-sig > -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html