is @ operator popular now?

Matt Wheeler m at funkyhat.org
Sat Jul 15 08:05:46 EDT 2017


On Sat, 15 Jul 2017, 12:35 oyster, <lepto.python at gmail.com> wrote:

> as the title says. has @ been used in projects?
>

Strictly speaking, @ is not an operator.
It delimits a decorator statement (in python statements and operations are
not the same thing).
However, to answer the question you actually asked, yes, all the time.

For specific examples, see:
pytest's fixtures
contextlib.contextmanager (makes creating context managers mich simpler in
most cases)
@property @classmethod etc. etc. (I sometimes see these used a bit too
freely, when a plain attribute or a function at the module level would be
more appropriate)

> --

--
Matt Wheeler
http://funkyh.at



More information about the Python-list mailing list