2 ms·
@decorator def decorated Is doing: decorated = decorator(decorated) The switch is implicit too. It's syntaxic sugar to gain a pratical and elegant sy
by sametmax 11y ago
@decorator
def decorated
Is doing:
decorated = decorator(decorated)
The switch is implicit too. It's syntaxic sugar to gain a pratical and elegant syntax for a common use case.
It's not going to introduce vulnerability.
It's going to make your code easier to write and read.
It's going to make bug easier to spot in formating.
It's going to make shell sessions easier.
- schmichael 11y agoThe manipulation (@dec) is still right next to the thing being manipulated (def dec). I'm not trying to be pedantic. It really does affect readability when syntactic sugar's affect spans an entire scope. Whether or not that effect on readability is greater or less than the gain by the syntactic sugar is always a matter of opinion. Obviously my opinion is out of line with Python's core devs.