擅长:python、mysql、java
<p>听起来你好像被3个不同的概念弄糊涂了,它们不是python特有的,而是(面向对象的)编程。你知道吗</p>
<ul>
<li><strong>属性是对象的值、特征。就像<code>array.shape</code></li>
<li><strong>方法是对象可以运行的函数,它可以执行的操作。<code>array.mean()</code></li>
<li><strong>静态方法是一类对象固有的函数,但不需要像<code>np.round_()</code>那样执行对象</li>
</ul>
<p>听起来您应该研究OOP:<a href="https://realpython.com/instance-class-and-static-methods-demystified/#instance-class-and-static-methods-an-overview" rel="nofollow noreferrer">here is a python primer on methods</a>。你知道吗</p>
<hr/>
<p>另外,一种更具python风格和特殊性的属性是<a href="https://www.programiz.com/python-programming/property" rel="nofollow noreferrer">^{<cd4>}</a>s,它们是(对象的)方法,不使用<code>()</code>调用。听起来有点奇怪,但可能是有用的,看看吧。你知道吗</p>