Scintilla’s Python lexer has a property `lexer.python.keywords2.no.sub.identifiers` which, when set to 1, prevents it from highlighting attributes as builtins.
In other words, with this property set to 1, a bare `file` is highlighted, because it’s a Python builtin, but the word `file` in `obj.file` is not highlighted, because it’s an unknown attribute of `obj`.
This is almost always the desired behavior and it should be the default. If someone has a peculiar codebase where `obj.file` is the same as the builtin `file`, they can flip the switch back in their `filetypes.python`.