我正在浏览开放堆栈的Tempest代码。我在类中看到了一些语法@,如下所示。有人可以给我一个正确的链接,我可以在上面了解为什么使用这个@。
@classmethod
def setUpClass(cls):
cls.set_network_resources()
super(TestLargeOpsScenario, cls).setUpClass()
甚至是这样,
@attr(type='smoke')
def test_update_setver_name(self):
name = rand_server('server')
那么@ over在这里的用途是什么?
答案 0 :(得分:1)
答案 1 :(得分:0)
@attr,装饰者DP。 更多有关Decorator DP的理解,例如: http://thecodeship.com/patterns/guide-to-python-function-decorators/