summaryrefslogtreecommitdiff
path: root/tests/interp/python-self/oword.py
blob: c562a4e2c4bd5784555c478d2faf880bc43f8ca1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import interpreter 

def retainparam1(self,x):
    self.param1 = x

def checkparam1_retained(self):
    if hasattr(self,'param1'):
        print "param1 was retained, value = ", self.param1
    else:
        return "param1 was not retained across invocations"

    # test object identity
    if hasattr(interpreter,'this'):
	print "this is self:", self is interpreter.this
    else:
        print "module interpreter: no 'this' attribute"