# Is it possible to change operator's bl_label on the fly?

I'd like to update the label of an operator when it's called. But this :

def execute(self,context):
self.bl_label = "good night"


... apparently doesn't work if the bl_label property has already been defined. Am I wrong ?

Manipulating an operator type once registered isn't supported. *

• override the label when drawing the interface. eg:
layout.operator("some.op", text=label_override)
• Modify the class, then re-register the operator
(unregister() & register())

Hint, if you want to do a conditional override, Python can do this by passing a dictionary...

keyword_args = {}
if some_test:
keyword_args["text"] = label_override
layout.operator("some.op", **keyword_args)


* (unless you modify the memory directly, which is possible but outside the scope of Blender/Python API).