Python 的 library stub 的集合 typesh
2019-03-14 本文已影响1人
78c40b03ee4e
前言
typeshed 是 Python 的 library stub 的集合,用于为Python标准库和Python内建,以及第三方软件包。此数据可用于静态分析,类型检查和类型推断。
语法示例
MAXYEAR = ... # type: int
MINYEAR = ... # type: int
__doc__ = ... # type: str
__file__ = ... # type: str
__name__ = ... # type: str
__package__ = ... # type: None
class date(object):
def __init__(self, year: int, month: int, day: int): ...
@classmethod
def fromtimestamp(cls, timestamp: int or float) -> date: ...
@classmethod
def fromordinal(cls, ordinal: int) -> date: ...
@classmethod
def today(self) -> date: ...
def ctime(self) -> str: ...
def weekday(self) -> int: ...