How can I make two decorators in Python that would do the following? 如何在Python中製做兩個裝飾器,以完成如下工做? app
@makebold @makeitalic def say(): return "Hello"
...which should return: ...應返回: this
"<b><i>Hello</i></b>"
I'm not trying to make HTML
this way in a real application - just trying to understand how decorators and decorator chaining works. 我並非想在真實的應用程序中以這種方式製做HTML
,而是試圖瞭解裝飾器和裝飾器連接的工做方式。 spa