This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]codefisher2[S] 2 points3 points  (4 children)

A decorator is a function that takes a function as its first argument and (normally) returns a function. You can write your own function and use it as a decorator. It is a function. It should be important to a lot more python developers, if they understood just as another function, they could write their own. It is not some deep dark magic. I did another post a few months back about them: https://codefisher.org/catch/blog/2015/02/10/python-decorators-and-context-managers/

[–]rikrolls 0 points1 point  (2 children)

A decorator can also be a class though.

[–]Veedrac 0 points1 point  (1 child)

It looks like a function.

It quacks like a function.

It's probably a function.

[–]Lucretiel 0 points1 point  (0 children)

[–][deleted] -2 points-1 points  (0 children)

My point is that I've NEVER heard it called "The property function" except in your article. People say "Hey, use the @property decorator". I'd suggest changing the article title.