Add attributes to function in python



  • Hi,

    I would like to add some descriptions to functions on top of every function

    ex :

    [Name = 'Test menu', Default=True, etc..]
    def test():
    pass

    My actual scenario is , I create Menus dynamically by reading all methods from a module at run time.

    So i don't want to take menu name as test, i want user to provide menu name on his wish in "Name" attribute of a function. There will be more attribute, not only Name.
    Is there any possibility in python, please anyone guide me ?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    This question is not Qt related, you should ask it on a python forum.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.