-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
- functions should have self or have @staticmethod directive
Error:
def activeDocument():
"code"
Solution:
def activeDocument(self):
"code"
- Multiple function definitions are not allowed in python from the get go but we can use the @multimethod directive
Error:
class Krita:
def Krita(QString):
"code"
def Krita(QObject,QString):
"code"
Solution:
class Krita:
@multimethod(QString,None)
def Krita(a,b):
"code"
@multimethod(QObject,QString)
def Krita(a,b):
"code"
- multiple args with the same name is not allowed in python. We could have the names of the args available in the cpp and their types in the class/function comments.
Error: def apply(Node,int,int,int,int):
Solution:
def apply(Node,x, y, w, h):
"""@param x : int
etc"""
Metadata
Metadata
Assignees
Labels
No labels