为什么 __pycache__ 目录没有被隐藏?

Why was the __pycache__ directory not made hidden?

我相信这个问题一定经常被问到,但我一直找不到或找不到答案

当 compiling/executing python 时,会创建一个 __pycache__ 目录,主要包含字节码,以便在下次使用该模块中的代码时赢得时间。

note that this can be suppressed

我的问题是为什么在设计语言时隐藏了 __pycache__ 目录?
(例如 unix 系统上的 .__pycache__

这是可能且可行的,因为 git 程序使用 .git 文件夹执行此操作,我相信它也隐藏在 windows 机器上

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.

基本上,他们想减少源代码目录中的混乱,但他们并没有试图隐藏实现,只是更好地划分它。