python/Lib
и открыть файл datetime.py
< именно его вы и импортируете. А в нём самом просто вызываемые методы. Да, там есть класс datetime
, но тут действует правило:The naming convention for functions may be used instead in cases where the interface is documented and used primarily as a callable.
Class Names
Class names should normally use the CapWords convention.
The naming convention for functions may be used instead in cases where the interface is documented and used primarily as a callable.
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.