【问题标题】:Python @ (at) prefix in top level module code - What does it stand for? [duplicate]顶级模块代码中的 Python @ (at) 前缀 - 它代表什么? [复制]
【发布时间】:2011-07-17 07:27:27
【问题描述】:

可能重复:
What does the @ symbol do in Python

我认为在这里提出这个问题是个好主意,因为谷歌完全忽略了查询中的@ 字符。

@ 在较早声明的函数名称之前在文档的顶层多次使用时,在 def´s 之前有什么作用?

Example

作为后续,它是否仍然存在于 Python 3 中?

【问题讨论】:

标签: python python-3.x


【解决方案1】:

Those are decorators

...是的,它们存在于 Python 3 中,请参阅...Python 3 primer, Part 2: Advanced topics

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-24
    • 2016-02-17
    • 1970-01-01
    • 2020-03-28
    • 2014-09-16
    相关资源
    最近更新 更多