I'd like to do something like this:
class Foo:
def test(self, arg):
self.test.x = 'prop x with ' + arg
print "test!"
f = Foo()
f.test('bar')
print f.test.x
And get as an output something like this:
test!
prop x with bar
But instead I get an AttributeError: 'instancemethod' object has no attribute 'x'
By the way I can do such thing with function:
def test(arg):
test.x = 'prop x ' + arg
print "test!"
test('bar')
print test.x
which works just fine.