From 3cc17c69ffd64dca55fe613f6e931585d8893c0d Mon Sep 17 00:00:00 2001 From: stijn Date: Sat, 14 Feb 2015 18:44:31 +0100 Subject: py: Allow retrieving a function's __name__. Disabled by default. Enabled on unix and stmhal ports. --- tests/basics/fun_name.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/basics/fun_name.py (limited to 'tests/basics') diff --git a/tests/basics/fun_name.py b/tests/basics/fun_name.py new file mode 100644 index 000000000..a7f9c6096 --- /dev/null +++ b/tests/basics/fun_name.py @@ -0,0 +1,16 @@ +def Fun(): + pass + +class A: + def __init__(self): + pass + def Fun(self): + pass + +try: + print(Fun.__name__) + print(A.__init__.__name__) + print(A.Fun.__name__) + print(A().Fun.__name__) +except AttributeError: + print('SKIP') -- cgit v1.2.3