Skip to main content
 Web开发网 » 编程语言 » Python语言

python 方法 函数 区别

2021年11月26日5180百度已收录

method

A function which is defined inside a class body. If called as an attribute of an instance of that class, the method will get the instance object as its first argument (which is usually called self).

中文大概就是method相当于类函数,其第一个参数是self

这是官方文档里的。要多看文档啊

评论列表暂无评论
发表评论
微信