2 ms·
I ran into a similar problem this morning-- using python tho. There is an api with multiple decorators possible. One decorator has implications for the program
by sophacles 17y ago
I ran into a similar problem this morning-- using python tho. There is an api with multiple decorators possible. One decorator has implications for the program execution model. Because python decorators take heavy advantage of closures, we run into a problem where external code cannot determine appropriate actions unless the decorator in question is the outermost decorator. This of course is an ugly requirement.
Our ultimate solution was to create a global table about if the relevant bit of state applies to the function (based on __name__). Also an ugly hack, but keeps the api clean. :(