[Tutor] why "self" in methods?

Chris Lott chris at chrislott.org
Sat Apr 3 21:52:27 EST 2004


Why do object methods need the (self) parameter rather than just 
accepting () as a function can? I mean, given:

class Foo:
	def doIt(self):
		print "did it"

why couldn't it be:
	def doIt():

c
--
Chris Lott
http://www.chrislott.org/



More information about the Tutor mailing list