Python Naming Conventions

Registered by nUboon2Age

Python Naming Conventions:
    "...here are the
    currently recommended naming standards. New modules and packages
    (including third party frameworks) should be written to these standards,
    but where an existing library has a different style, internal consistency
    is preferred.
...
  Prescriptive: Naming Conventions
...
Package and Module Names
      Modules (ie. files) should have short, all-lowercase names. Underscores can be used
      in the module name if it improves readability. Python packages should
      also have short, all-lowercase names, although the use of underscores is
      discouraged.
Class Names
      Almost without exception, class names use the CapWords convention.
      Classes for internal use have a leading underscore in addition.
Exception Names
      Because exceptions should be classes, the class naming convention
      applies here. However, you should use the suffix "Error" on your
      exception names (if the exception actually is an error).
Global Variable Names
        (Let's hope that these variables are meant for use inside one module
      only.) The conventions are about the same as those for functions.
        Modules that are designed for use via "from M import *" should use the
      __all__ mechanism to prevent exporting globals, or use the older
      convention of prefixing such globals with an underscore (which you might
      want to do to indicate these globals are "module non-public").
Function Names
        Function names should be lowercase, with words separated by underscores
      as necessary to improve readability.
        mixedCase is allowed only in contexts where that's already the
      prevailing style (e.g. threading.py), to retain backwards compatibility.
Function and method arguments
      Always use 'self' for the first argument to instance methods.
      Always use 'cls' for the first argument to class methods.
Method Names and Instance Variables
        Use the function naming rules: lowercase with words separated by
      underscores as necessary to improve readability.
        Use one leading underscore only for non-public methods and instance
      variables.
Constants
         Constants are usually declared on a module level and written in all
       capital letters with underscores separating words. Examples include
       MAX_OVERFLOW and TOTAL.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Medium
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Discussion
Series goal:
Accepted for trunk
Implementation:
Informational Informational
Milestone target:
milestone icon ver0.4

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.