Skip to content
UPEEC

Identifiers

The rules for naming variables, functions and classes.

Beginner
Comments 0
  • Letters, digits and _; can't start with a digit; can't be a keyword.
  • Conventions (PEP 8): snake_case for variables and functions, PascalCase for classes, UPPER_CASE for constants.
  • A leading _name means "internal"; __name inside a class triggers name mangling; __name__ is reserved for special ("dunder") names.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.