Saturday, July 19, 2008

Somebody please tell me why the following code does not work as one would expect (that is, printing out text when setting/getting someASDF.text):

class asdf:
def click(self):
print "click"
def getText(self):
print "getText"
def setText(self, val):
print "setText"
text = property(lambda self: self.getText(), lambda self, v: self.setText(v))

1 comment:

  1. Zach -- if you just say

    text = property(getText, setText)

    it seems to work for me.

    Grig

    ReplyDelete