Question
· Jun 27

What is best practice for calling macros from Embedded Python?

I was wondering what best practice was for using macros in Embedded Python, i.e. iris.execute('$$$MACRO()') or something else. Does anyone have insight into this?

Product version: IRIS 2025.1
Discussion (2)4
Log in or sign up to continue

One quick answer is a helper ObjectScript class with a wrapper classmethod for each macro. If the helper class can inherit from the class that provides the macros (for example: CustomPackage.TestCase extends %UnitTest.TestCase) then you can replace $$$Macro(args) with self.Macro(args). Otherwise, your helper class must include the INC file that defines the macros, and other classes can call the class methods directly: iris.CustomPackage.HelperClass.Macro(args).