On Thu, 09 Feb 2017 08:03:32 +0100, ast wrote: > Hi > > In python courses I read, it is explained that > > @decor > def f(): > pass > > is equivalent to: > > def f(): > pass > > f = decor(f) > > But that's not always true. See this code [...] > any comment ?
Congratulations, you've found a microscopic corner of the language where the two different ways of applying decorators are different. Are you just sharing with us, or do you think there is a problem that needs to be solved? You're absolutely correct that when using `property`, trying to apply it by hand instead of using the @ syntax is tricky. So don't apply it by hand, use the @ syntax. -- Steve -- https://mail.python.org/mailman/listinfo/python-list