From 1639200e5700b1170a9d2312a32c7991ed5198b4 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 20 Jan 2017 13:17:22 +1100 Subject: [PATCH] tests/basics: Add test for assignment of attribute to bound method. --- tests/basics/boundmeth1.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/basics/boundmeth1.py b/tests/basics/boundmeth1.py index a728872755..f483ba406d 100644 --- a/tests/basics/boundmeth1.py +++ b/tests/basics/boundmeth1.py @@ -22,3 +22,9 @@ print(m(1)) # bound method with lots of extra args m = A().h print(m(1, 2, 3, 4, 5, 6)) + +# can't assign attributes to a bound method +try: + A().f.x = 1 +except AttributeError: + print('AttributeError')