An operator to send messages to the user?

I’m trying to make this operator

import bpy
from bpy.props import StringProperty
from bpy.types import Operator, Context

bl_info = {
    "name": "MyAddon",
    "description": "MyAddon",
    "blender": (4, 1, 1),
    "version": (0, 0, 1),
    "category": "Physics"
}

class MYADDON_OT_info_report(Operator):
    bl_idname = "myaddon.info_report"
    bl_label = "Report"
    bl_description = "Report Class"

    report_txt: StringProperty(default="")

    def execute(self, context: Context):
        self.report({'INFO'}, self.report_txt)
        return {'FINISHED'}

def register():
    bpy.utils.register_class(MYADDON_OT_info_report)

def unregister():
    bpy.utils.unregister_class(MYADDON_OT_info_report)

if __name__ == "__main__":
    register()

so that I can call it from anywhere in my addon with a

bpy.ops.myaddon.info_report(report_txt='Hellow World')

but I don’t know what I’m doing wrong that isn’t working for me, any suggestions?

Did you try to run your code in Text Editor? You should see error about this line.

Change it to this, and your script should run.

def execute(self, context):

Yes, sorry I forgot an import. You can do what you say or import Context if you like to type things.

from bpy.types import Operator, Context

In any case I don’t understand why it doesn’t work, it doesn’t launch the message in the bottom status bar…

I’ve ran into the same problem in the past, but was not able to find a solution or workaround. It’s confirmed as a bug here: https://projects.blender.org/blender/blender/issues/97284