Edgewall Software

Version 5 (modified by Christopher Lenz, 18 years ago) ( diff )

Trac Coding Style

Like most Python projects, we try to adhere to PEP 8 (Style Guide for Python Code). Be sure to read that document if you intend to contribute code to Trac.

Note that some of the current Trac code violates a couple of the rules below. We are currently in the process of refactoring the offending modules so that all code uses the same conventions.

Naming conventions

  • Package and module names should be all lower-case, words may be separated by underscores.
  • Class names use CamelCase.
  • The names of functions, variables and class members use all lower-case, with words separated by underscores.
  • Internal methods and variables are prefixed with a single underscore.

Miscellaneous

  • Lines shouldn't exceed a length of 80 characters.
  • Prefer list comprehension to the built-in functions filter() and map() when appropriate.

See also: TracDev

Note: See TracWiki for help on using the wiki.