× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Python decorators - order matters

<p>When you decorate a function with multiple decorators the one at the bottom is called first</p> <p> </p> <p>@baz<br> @foo<br> def bar():</p> <p>    pass</p> <p> </p> <p>That will decorate bar first with foo and then the foo-decorated function will be decorated again with baz.</p>
comments powered by Disqus