我是来自 PHP 的 Python 新手,我知道 Python 有 Docstrings,但是如何在类变量上做到这一点?假设在 PHP 中我有:
class Animal {
/**
* @var Noise
*/
public $noise
}
现在我将如何实现这是python?就像是:
class Animal:
# Here I want to tell my IDE that this is a noise object, not yet set
self.noise = None