dave wrote:
Is it even possible to replace the implicit self argument of the initializer
by passing something else?  If so, what would be the syntax.

Im not sure  this is what you mean but...

When you call a method on an object like:

class MyClass:
   def aMethod(self,spam): pass

anObject= MyClass()
anObject.aMethod(42)

You could replace the last line with:

MyClass.aMethod(anObject, 42)

This explicitly specifies the value of self in aMethod()

So you could in theory pass any object into the method,
although in most cases it would result in an error.


Is that what you mean?

Alan G.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to