[IronPython] Threading/Delegates
Edd Dumbill
edd at usefulinc.com
Mon Aug 9 22:49:07 CEST 2004
On Mon, 2004-08-09 at 15:15 -0400, Dan Lash wrote:
>
> The first thing I noticed is that I can't seem to get any class
> declarations going. Even this doesn't work:
>
> class Test:
> def Hello():
> print "Hello"
That's because Python methods need the 'this' reference (pronounced
'self' in Python) as their first argument:
class Test:
def Hello (self):
print "Hello"
if __name__ == '__main__':
t = Test ()
t.Hello ()
-- Edd
--
Edd Dumbill, Editor-at-Large, O'Reilly Network
More from me on my weblog -- http://usefulinc.com/edd/blog
Mono book -- http://usefulinc.com/edd/books/mono-notebook
More information about the Ironpython-users
mailing list