This is a question that I believe must have been asked often, but which I have been unable to find or find an answer to
When compiling/executing python, a __pycache__
directory is created, mostly containing bytecodes to gain time the next time the code in that module is used.
note that this can be suppressed
My question is why was the __pycache__
directory made hidden when the language was designed?
(for example .__pycache__
on unix systems)
This is possible and doable as the git program does it with the .git
folder, which I believe is also hidden on windows machines
The PEP itself mentions this as a rejected proposal:
.pyc
A proposal was floated to call the
__pycache__
directory.pyc
or some other dot-file name. This would have the effect on *nix systems of hiding the directory. There are many reasons why this was rejected by the BDFL [20] including the fact that dot-files are only special on some platforms, and we actually do not want to hide these completely from users.
Basically, they wanted to reduce the clutter in the source code directory, but they weren't trying to hide implementation, just compartmentalize it better.