home *** CD-ROM | disk | FTP | other *** search
- <TITLE>Methods -- Python library reference</TITLE>
- Next: <A HREF="../c/code_objects" TYPE="Next">Code Objects</A>
- Prev: <A HREF="../f/functions" TYPE="Prev">Functions</A>
- Up: <A HREF="../o/other_built-in_types" TYPE="Up">Other Built-in Types</A>
- Top: <A HREF="../t/top" TYPE="Top">Top</A>
- <H3>2.1.7.4. Methods</H3>
- Methods are functions that are called using the attribute notation.
- There are two flavors: built-in methods (such as <CODE>append()</CODE> on
- lists) and class instance methods. Built-in methods are described
- with the types that support them.
- <P>
- The implementation adds two special read-only attributes to class
- instance methods: <CODE><VAR>m</VAR>.im_self</CODE> is the object whose method this
- is, and <CODE><VAR>m</VAR>.im_func</CODE> is the function implementing the method.
- Calling <CODE><VAR>m</VAR>(<VAR>arg-1</VAR>, <VAR>arg-2</VAR>, <R>...</R>,
- <VAR>arg-n</VAR>)</CODE> is completely equivalent to calling
- <CODE><VAR>m</VAR>.im_func(<VAR>m</VAR>.im_self, <VAR>arg-1</VAR>, <VAR>arg-2</VAR>, <R>...</R>, <VAR>arg-n</VAR>)</CODE>.
- <P>
- (See the Python Reference Manual for more info.)
- <P>
-