📜  是文件在python代码示例中的关键字

📅  最后修改于: 2022-03-11 14:45:39.602000             🧑  作者: Mango

代码示例1
#No, file is a builtin, not a keyword:
>>> import keyword
>>> keyword.iskeyword('file')
False
>>> import __builtin__
>>> hasattr(__builtin__, 'file')
True
It can be seen as an alias for open(), 
but it has been removed from Python 3, 
as the new io framework replaced it. 
Technically, it is the type of object returned by the open() function.