是否有任何正确的类型提示用于Python中的文件或类文件对象?例如,我如何键入提示此函数的返回值?
def foo(): return open('bar')
python type-hinting
我想使用isinstance内置函数来判断的类型open(file)。
isinstance
open(file)
怎么做?
谢谢!:D
python filehandle python-2.7 isinstance
python ×2
filehandle ×1
isinstance ×1
python-2.7 ×1
type-hinting ×1