home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / python / pyhtmldoc / m / methods < prev    next >
Text File  |  1996-11-14  |  1KB  |  21 lines

  1. <TITLE>Methods -- Python library reference</TITLE>
  2. Next: <A HREF="../c/code_objects" TYPE="Next">Code Objects</A>  
  3. Prev: <A HREF="../f/functions" TYPE="Prev">Functions</A>  
  4. Up: <A HREF="../o/other_built-in_types" TYPE="Up">Other Built-in Types</A>  
  5. Top: <A HREF="../t/top" TYPE="Top">Top</A>  
  6. <H3>2.1.7.4. Methods</H3>
  7. Methods are functions that are called using the attribute notation.
  8. There are two flavors: built-in methods (such as <CODE>append()</CODE> on
  9. lists) and class instance methods.  Built-in methods are described
  10. with the types that support them.
  11. <P>
  12. The implementation adds two special read-only attributes to class
  13. instance methods: <CODE><VAR>m</VAR>.im_self</CODE> is the object whose method this
  14. is, and <CODE><VAR>m</VAR>.im_func</CODE> is the function implementing the method.
  15. Calling <CODE><VAR>m</VAR>(<VAR>arg-1</VAR>, <VAR>arg-2</VAR>, <R>...</R>,
  16. <VAR>arg-n</VAR>)</CODE> is completely equivalent to calling
  17. <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>.
  18. <P>
  19. (See the Python Reference Manual for more info.)
  20. <P>
  21.