magnum/HACKING.rst
Hongbin Lu 0b9b7de79a Eliminate mutable default arguments
The best practice in Python is not to use mutable object (i.e. list,
dictionary, or instances of most classes) as value of default argument.

See: https://docs.python.org/2/tutorial/controlflow.html#default-argument-values

This patch also added a hacking rule to enforce this practice.

Change-Id: I4aa8aede57d6fd31b4b30c3f7535b819e591165d
Closes-Bug: 1471349
2015-07-10 13:33:49 +00:00

362 B

Magnum Style Commandments

Magnum Specific Commandments ---------------------------

  • [M301] policy.enforce_wsgi decorator must be the first decorator on a method.
  • [M322] Method's default argument shouldn't be mutable.