summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/class_call.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-25 23:45:52 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-25 23:45:52 +0100
commitc492cf1f442653019b287bf0e8bd0c43f2abd837 (patch)
tree080ca4ed09ce63c6edd3cfc8bf0c6e8298588eb6 /tests/basics/class_call.py
parentdaab651c5ca0d7198f6db2fa0abe2399fc08c69e (diff)
parent755565d2cbc7c7f7abe6f457012b49ddf6b23ca1 (diff)
downloadmicropython-c492cf1f442653019b287bf0e8bd0c43f2abd837.tar.gz
micropython-c492cf1f442653019b287bf0e8bd0c43f2abd837.zip
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'tests/basics/class_call.py')
-rw-r--r--tests/basics/class_call.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/basics/class_call.py b/tests/basics/class_call.py
new file mode 100644
index 0000000000..b7a3d70f9e
--- /dev/null
+++ b/tests/basics/class_call.py
@@ -0,0 +1,18 @@
+class C1:
+ def __call__(self, val):
+ print('call', val)
+ return 'item'
+
+class C2:
+
+ def __getattr__(self, k):
+ pass
+
+c1 = C1()
+print(c1(1))
+
+c2 = C2()
+try:
+ print(c2(1))
+except TypeError:
+ print("TypeError")