# Incompatible operator return type in simple empty adding operator

I have a simple script:

import bpy
from bpy.types import Panel,Operator

def execute(self,context):
return '{FINISHED}'

bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
def draw(self, context):
layout = self.layout
scn = context.scene
row = layout.row()

def register():
def unregister():

if __name__ == "__main__":
register()


Which seems to work, but after pressing the button, a huge error appears:

RuntimeError: class MARKER_OT_add, function execute: incompatible return value , str(, Function.result expected a set, not a NoneType)

which I have no idea why. Is the execute function from MarkerAdd operator supposed to have a different result type? It does not matter whether I put there '{FINISHED}' or not.

OK, I realized that I made a typo/mistake. In the MarkerAdd operator, in the function execute I've put

def execute(self, context):
(....)
return '{FINISHED}'


which is a string, while it should be a Set:

def execute(self, context):
(....)
return {'FINISHED'}


Notice apostrophes. That simple mistake caused me to get lost in and I waste hours trying to understand what's wrong. I hope somebody could avoid similar mistake.