How do I do this without class methods ?

Courageous jkraska1 at san.rr.com
Wed May 2 21:56:35 EDT 2001


>My problem is that it seems simple enough to do with class methods,
>but I don't seem to be able to find a way around their absence. What's
>the pythonic way to do this ?

>    def welease_bwian ( self, N ):
>        self.wodger = self.bwian[N]

	if isinstance(self,mypackage.Object1):  print "good"
	if isinstance(self,mypackage.Object2):  print "good"
	raise "bad"

This should give you the answer to your question.

C//




More information about the Python-list mailing list