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()
ObjectScriptObjectScript
and the same call in EmbeddedPython:
iris.cls('eshvarov.sample.SeaBattle.GamePython').SetupGame()
PythonPython
Thoughts?
Product version: IRIS 2022.1
Maybe
Unfortunately no. self is for the object instance I guess
Maybe it makes sense to add something like cself or Self to refer to a class inside classmethods. @Bob Kuszewski ?
I use and just verifiied
iris.cls(__name__).SetupGame()
This works! Thanks, @Robert Cemper!
Hi @Robert Cemper, a belated thank you. I have added your tip to the documentation here: https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...