source: git/Tst/Manual/pyobject_related_functions.tst @ 951db29

spielwiese
Last change on this file since 951db29 was 894057, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
ADD: Tests from online manual (res+stat on mamawutz): short ones Tst/Manual/s.lst
  • Property mode set to 100644
File size: 488 bytes
Line 
1LIB "tst.lib"; tst_init();
2  pyobject pystr = "Kublai Khan";
3
4  // Additional functionality through attrib
5  attrib(pystr, "__doc__");
6  proc(attrib(pystr, "count"))("K");
7
8  pystr."__doc__";           // <- Short notations
9  pystr.count("a");          // Even shorter (if attribute's name is valid and unused)
10
11  python_run("def func(): return 17");
12  attrib(func);
13  attrib(func, "func_name");
14  attrib(func, "func_name", "byAnyOtherName");
15  attrib(func, "func_name");
16tst_status(1);$
Note: See TracBrowser for help on using the repository browser.