diff doc/v2_planning/API_coding_style.txt @ 1257:d79070c60546

merge
author gdesjardins
date Fri, 24 Sep 2010 12:54:27 -0400
parents 705795076efd
children b5673b32e8ec
line wrap: on
line diff
--- a/doc/v2_planning/API_coding_style.txt	Fri Sep 24 12:53:53 2010 -0400
+++ b/doc/v2_planning/API_coding_style.txt	Fri Sep 24 12:54:27 2010 -0400
@@ -218,6 +218,19 @@
         def f(array=[]): # Dangerous if `array` is modified down the road.
             ...
 
+    * All top-level classes should inherit from ``object``. It makes some
+      'under-the-hood' differences that can be very useful for Python black
+      magic adepts.
+
+      .. code-block:: python
+
+        # Good.
+        class MyClass(object):
+            pass
+        # Bad.
+        class MyClass:
+            pass
+
     * Always raise an exception with ``raise MyException(args)`` where ``MyException``
       inherits from ``Exception``. This is required for compatibility across
       all versions of Python.