What is inserted for indentation is set in `Document->Indent Type->Spaces` and number by `Document->Indent Width->4` (or whatever).
The values for those two settings are set on loading a file is to the value in preferences or project properties which overrides the preferences if a project is open.
Both of those have a `Detect from file` option which you may prefer if your files are consistent (which Python files should be)