Python - Decorators

后端 未结 5 461
礼貌的吻别
礼貌的吻别 2020-12-10 12:32

I\'m trying to learn Decorators . I understood the concept of it and now trying to implement it.

Here is the code that I\'ve written The code is se

5条回答
  •  盖世英雄少女心
    2020-12-10 13:03

    What about this .

    def wrapper(func):
        def inner():
            if isinstance(func,int):
                    return func(x, y)
            else: return 'invalid values'
    
        return inner()
    

提交回复
热议问题