diff options
Diffstat (limited to 'tests/basics/class_use_other.py')
-rw-r--r-- | tests/basics/class_use_other.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basics/class_use_other.py b/tests/basics/class_use_other.py new file mode 100644 index 0000000000..c6aa94ad25 --- /dev/null +++ b/tests/basics/class_use_other.py @@ -0,0 +1,12 @@ +# check that we can use an instance of B in a method of A + +class A: + def store(a, b): + a.value = b + +class B: + pass + +b = B() +A.store(b, 1) +print(b.value) |