aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-03-18 11:16:50 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:15:18 -0300
commit4142bd57ece86b1087915b2bb091fcc58219eed1 (patch)
treee037245fe85967e7e9a69dc147774e4b9851b0f4 /doc
parentb5bfa9837fd084edb5cc79b44760161d7d872c08 (diff)
Created documentaion due to the limitation with old style class.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/wordsofadvice.rst38
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/wordsofadvice.rst b/doc/wordsofadvice.rst
index d27cae00f..e3ff50159 100644
--- a/doc/wordsofadvice.rst
+++ b/doc/wordsofadvice.rst
@@ -69,3 +69,41 @@ Although duck punching is an interesting Python feature, it don't mix well with
C++ virtual methods, specially when you can't tell the origin of every single wrapped
C++ object. In summary: don't do it!
+
+.. _pyside-old-style-class:
+
+Python old style classes and PySide
+===================================
+
+Because of some architectural decisions and deprecated Python types. Since PySide 1.1 old style classes are not supported with multiple inheritance.
+
+Below you can check the examples:
+
+Example with old style class:
+
+ .. code-block:: python
+
+ from PySide import QtCore
+
+ class MyOldStyleObject:
+ pass
+
+ class MyObject(QtCore, MyOldStyleObject):
+ pass
+
+
+this example will raise a 'TypeError' due to the limitation on PySide, to fix this you will need use the new style class:
+
+
+ .. code-block:: python
+
+ from PySide import QtCore
+
+ class MyOldStyleObject(object):
+ pass
+
+ class MyObject(QtCore, MyOldStyleObject):
+ pass
+
+
+All classes used for multiple inheritance with other PySide types need to have 'object' as base class.