下面是我无法在.py文件中找到实现的代码:
def distance(self):
"""Measures the relative distance between the sensor and an object using
infrared light.
Returns:
:ref:`relativedistance`: Relative distance ranging from 0 (closest)
to 100 (farthest).
"""
pass发布于 2022-03-01 15:04:36
您所展示的代码是一个什么都不做的类方法,所以我假设您认为模块中有一个类定义,它会子类并重写该方法?你只要去找就行了。
如果包含您显示的函数的类定义称为BaseClass,那么您要查找的内容如下
class MyClass(BaseClass):
# some other stuff here
def distance(self):
# this is what you are looking for显然,MyClass是一个示例名称,它可能被称为任何东西。
https://stackoverflow.com/questions/71310251
复制相似问题