[Tutor] class instance with identity crisis

Alan Gauld alan.gauld at freenet.co.uk
Wed Jan 12 21:12:39 CET 2005


Whoops, I forgot to do an assignment...

> So try
> 
>      def dry(self): return Prune()
> 
> > class Prune:
> >     def __str__(self):
> >         return 'prune'
> > 
> > weapon = Damson()
> > weapon.dry()

weapon = weapon.dry()

> > print weapon
> 
> Should work as expected...

Alan G


More information about the Tutor mailing list