Right now ioutil.TempFile creates files with a given prefix as the basename. This is fine for the usual /tmp usage, where all the files in that directory are temporary files. However, for e.g. replacing a state file ~/.foo.json with a new one, what I'd want is writing to e.g. ~/.foo.<RANDOMNESS>.tmp and renaming that over ~/.foo.json. This way I can make e.g. backup and editor software ignore *.tmp files, and even clean old leftover temp files automatically.