Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Possible duplicate: <a href="https://stackoverflow.com/questions/625083/python-init-and-self-what-do-they-do">Python __init__ and self what do they do?</a></p> <p><code>def print_word(word)</code> is a function (or method/procedure). <code>__init__(self)</code> is a function used within a <strong>class</strong>.</p> <p>This <a href="http://docs.python.org/tutorial/classes.html#class-objects" rel="nofollow noreferrer">section</a> of the Python tutorial on classes describes the <code>__init__</code> function. I'd highly recommend reading that entire page, btw.</p> <p><code>self</code> is an arbitrary choice of a word to refer to the class itself; if you wanted, you could use <code>watermelon</code>. See: <a href="https://stackoverflow.com/questions/2709821/python-self-explained">What is the purpose of self?</a></p> <p>Python class functions wrapped with the double underscore have a special meaning. Another example is <code>__str__</code>. This <a href="http://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles" rel="nofollow noreferrer">section</a> of PEP8 (an important Python style document) explains the meaning of underscores in Python.</p> <hr> <p>Superclasses:</p> <ul> <li>The inheritance <a href="http://docs.python.org/tutorial/classes.html#inheritance" rel="nofollow noreferrer">section</a> of the Python class tutorial</li> <li><a href="https://stackoverflow.com/questions/3694371/how-do-i-initialize-the-base-super-class-in-python">How do I initialize the base (super) class?</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload