Simple questions about classes

Natan nvivo at terra.com.br
Tue Feb 11 20:48:07 CET 2003


Hi, i`m a newbie in python, and i was reading the tutorial (and some
source codes), then i noticed that every function inside a class
receives the 'self' parameter.

Like this exemple in python tutorial:

---
class MyClass:
    "A simple example class"
    i = 12345
    def f(self):
        return 'hello world'
---

I think self points to the class, but why do we need to pass this
parameter to every function?




More information about the Python-list mailing list