[Tutor] understanding classes

alan.gauld@bt.com alan.gauld@bt.com
Wed, 14 Aug 2002 15:07:13 +0100


> I have one question:  As far as you know, is "self" in Python 
> basically the same as "this" in Java?

Exactly so and if it helps you can even call it 'this':

class Foo:
   baz = "Class Foo"
   def bar(this):
     return this.baz


Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld