在dlib python API文档中,“->无”是什么意思?

问题描述

在dlib Python api文档中,我看到了这些内容(忽略颜色,我不知道为什么..),
(来自http://dlib.net/python/index.html#dlib.rectangles

class dlib.chip_details
WHAT THIS OBJECT REPRESENTS This object describes where an image chip is to be extracted from within another image. In particular,it specifies that the image chip is contained within the rectangle self.rect and that prior to extraction the image should be rotated counter-clockwise by self.angle radians. Finally,the extracted chip should have self.rows rows and self.cols columns in it regardless of the shape of self.rect. This means that the extracted chip will be stretched to fit via bilinear interpolation when necessary.

__init__(*args,**kwargs)
Overloaded function.

__init__(self: dlib.chip_details,rect: dlib.drectangle) -> None
__init__(self: dlib.chip_details,rect: dlib.rectangle) -> None
ensures
self.rect == rect_
self.angle == 0
self.rows == rect.height()
self.cols == rect.width()
__init__(self: dlib.chip_details,rect: dlib.drectangle,size: int) -> None
__init__(self: dlib.chip_details,rect: dlib.rectangle,size: int) -> None
ensures
...

“->无”是什么意思?

解决方法

-> None是python typing的一部分。在这种情况下,意味着该函数不返回任何内容。

注意Python运行时不强制执行函数和变量类型注释。第三方工具(例如类型检查器,IDE,Linters等)可以使用它们。