Python命名约定

2022-08-06

以下示例是关于Python中包含Python命名约定用法的示例代码,想了解Python命名约定的具体用法?Python命名约定怎么用?Python命名约定使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。

[英]:Python naming conventions源码类型:Python
Packages: short, all-lowercase names. Preferably no underscores.=>utilities

Modules: short, all-lowercase names. Can have underscores.	=> db_utils

Classes: CapWords (upper camel case) convention 			=> BankAccount

Functions: lowercase, words separated by underscores  		=> open_account
(snake_case)

Variables: lowercase, words separated by underscores 		=> account_id
(snake_case)

Constants: all-uppercase, words separated by underscores	=> MIN_APR

本文地址:https://www.itbaoku.cn/snippets/795577.html