为什么Python中的一些内置类在CapWords中,而另一些不是?

2024-10-03 11:18:08 发布

您现在位置:Python中文网/ 问答频道 /正文

在pep8中,Guido说Python类除了内置类之外,其他都应该大写:

Note that there is a separate convention for builtin names: most builtin names are single words (or two words run together), with the CapWords convention used only for exception names and builtin constants.

我很好奇:为什么有些内置类在CapWords中,而另一些不是?例如,datetime模块中的类(datetime、date、timedelta等)不大写。但是,请求(在urllib中)和队列是。在

这背后有什么原因或故事吗?在


Tags: fordatetimethatnamesis内置noteconvention