[Baypiggies] bound and unbound methods

Ian Zimmerman itz at buug.org
Sat Jun 23 07:53:25 CEST 2012


Is there any semi-clean way to transform an unbound method into a bound
one?

class K(object):

      def meth(self, junk):
          print junk

      meth_cell = meth

      def another(self, gunk):
          # this doesn't work, what does?
          self.meth_cell(gunk)

-- 
Ian Zimmerman
gpg public key: 1024D/C6FF61AD
fingerprint: 66DC D68F 5C1B 4D71 2EE5  BD03 8A00 786C C6FF 61AD
http://www.gravatar.com/avatar/c66875cda51109f76c6312f4d4743d1e.png
Rule 420: All persons more than eight miles high to leave the court.


More information about the Baypiggies mailing list