confused about self, why not a reserved word?
globalrev
skanemupp at yahoo.se
Mon May 5 09:37:35 EDT 2008
sorry i noticed now a little error, i was playing around a lot and saw
that on the sel-example i had then called foo.hello() instead of
foo.Hello().
but it was an informing error now i egt it. was wondering about self
anyway so thanks for clearing it up.
but it still is a bit confusing that u can pass with any word.
wouldnt:
class Foo(object):
def Hello():
print "hi"
make more sense?
the class-thing seems inside out somehow in python. if im doing
foo.Hello() im already saying that im using the class foo because i
did foo=Foo() before and then still when calling Hello() i am
invisibly passing the class itself a s a parameter by default?
just seems backwards and weird.
More information about the Python-list
mailing list