class C(B): ...

问题描述 投票:0回答:1
The
character denotes a decorator. Decorators are functions that can modify or extend behavior of another function temporarily by wrapping around them.

在Python中,"at"(@)符号有什么作用?super() help() (12个回答)

This works for class methods too: | class C(B): | @classmethod | def cmeth(cls, arg): | super().cmeth(arg)

@ classmethod封闭

2个月前@.

python-3.x
1个回答
2
投票

的方法,在python中使用 @ 在IDLE中,我遇到了这段代码。

在第二行,你可以看到 @ 签上 classmethod .cmeth什么?

符号在python中的作用和用途是什么?classmethod 我在使用IDLE中的help()函数查看python内置的super()方法的方法和文档。我看到了这段代码 这也适用于类方法。

© www.soinside.com 2019 - 2024. All rights reserved.