--- title: method 方法 --- !!! info 在类内部定义的函数。如果作为该类的实例的一个属性来调用,方法将会获取实例对象作为其第一个 [argument] (通常命名为 self)。参见 [function] 和 [nested scope]。 [argument]: https://docs.python.org/zh-cn/3/glossary.html#term-argument [function]: https://docs.python.org/zh-cn/3/glossary.html#term-function [nested scope]:https://docs.python.org/zh-cn/3/glossary.html#term-nested-scope