Pyi are binary files, they are able to save the password. It seems that they are a bit faster than mdl files.
If you are making lots of changes in the Pyi , from time to time save it as MDL , and resave the mdl to Pyi. All the changes in the Pyi are making the Pyi bigger and bigger, by saving it to mdl then to pyi again , you are removing the un-necessary data from the pyi and making the pyi file smaller.
MDL files can be opened in notepad.
Recommandation if you are working with PYI, is to have always a backup in MDL. If the pyi is corrupted ( it happens ...) there is no way to fix it.
Have a look to this
post