python send object reference to another function and edit property

Solutions on MaxInterview for python send object reference to another function and edit property by the best coders in the world

showing results for - "python send object reference to another function and edit property"
Sarah
05 May 2016
1class Test:
2  a = 1
3
4def f(obj):
5  obj.a = 10
6
7t = Test()
8f(t)
9
10# t.a should be 10