|
|
|
|
|
by devxpy
2735 days ago
|
|
Well, You'll be happy to know that a decorator is literally just a function that takes another function as its first argument. @app.route(...)
def login():
...
Is literally the same thing as - def login():
...
login = app.route(login, ...)
Hopefully that clears up the air a bit? |
|
I don't know if me saying 'Just, why?' is a good enough reason to throw my arms up and say it's an idea I'm not a fan of. I'm willing to say that it's a rather subjective attitude.
I guess my retort is that, it's far more confusing to have that syntax, then explain what it meant, when I could've just used the conventional syntax.
It's not like it's offering me something substantially simpler. For example, the spread operator that was introduced. It actually allows you to write clearer JavaScript code. This syntax isn't intuitively clear like the rest operator is.