["python","keyword"]
Is 'file' a keyword in python?

Is file a keyword in python? I've seen some code using the keyword file just fine, while others have suggested not to use it and my editor is color coding it as a keyword.
No, file is not a keyword: >>> import keyword >>> keyword.iskeyword('file') False The name is not present in Python 3. In Python 2, file is a built-in: >>> import __builtin__, sys >>> hasattr(__builtin__, 'file') True >>> sys.version_info[:2] (2, 7) It can be seen as an alias for open(), but it was removed in Python 3, where the new io framework replaced it. Technically, it is the type of object returned by the Python 2 open() function.