Simple questions about classes
Natan
nvivo at terra.com.br
Tue Feb 11 14:48:07 EST 2003
More information about the Python-list mailing list
Tue Feb 11 14:48:07 EST 2003
- Previous message (by thread): Simple questions about classes
- Next message (by thread): Simple questions about classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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?
- Previous message (by thread): Simple questions about classes
- Next message (by thread): Simple questions about classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list