__self__ on built-in functions
Роман Донченко <[email protected]> Mon, 13 Feb 2012 20:43:47 +0400
| Newsgroups | gmane.comp.python.documentation |
|---|---|
| Message-ID | <op.v9ml29bk3qy9a8@tortoise> |
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__ <module 'builtins' (built-in)> >>> open.__self__ <module 'io' (built-in)> >>> import math >>> math.sin.__self__ <module 'math' (built-in)> Thoughts? Roman. _______________________________________________ Doc-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/doc-sig