Written by

Senior Startups and Community Programs Manager at InterSystems Corporation
Question Evgeny Shvarov · Oct 2, 2022

How to refer to a Classmethod of the same Class using Embedded Python?

Hi folks!

How can I refer to a classmethod of the same class while coding another classmethod with Embedded python?

I know that I can call it with iris.cls(classname).MethodName(), but it's more cumbersome even comparing with ObjectScript, where I can call ..MethodName().

Compare ObjectScript:

do..SetupGame()

and the same call in EmbeddedPython:

    iris.cls('eshvarov.sample.SeaBattle.GamePython').SetupGame()

 

Thoughts?

Product version: IRIS 2022.1

Comments

Evgeny Shvarov  Oct 3, 2022 to Eduard Lebedyuk

Unfortunately no. self is for the object instance I guess

0
Evgeny Shvarov  Oct 3, 2022 to Eduard Lebedyuk

Maybe it makes sense to add something like cself or Self to refer to a class inside classmethods. @Bob Kuszewski ?

0
Robert Cemper · Oct 2, 2022

I use and just verifiied 

iris.cls(__name__).SetupGame()

0