[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt]  Fwd: Mixin classes and PyQt4
From:       Martin Teichmann <martin.teichmann () gmail ! com>
Date:       2014-02-12 9:35:56
Message-ID: CAK9R32R73NmJqtxnBpD7vQbt1RtwVwUGrsth11vNxycy8nV0SA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Phil, Hi Baz, Hi List,

I just wrote a patch as advertised earlier, which checks that the
inheritance is correct and that noone attempts to inherit from more
than one PyQt base class. It is based on the patch sent earlier.
Maybe this is an improvement enough to put my patches in?

Greetings

Martin

Patch follows:

--- siplib.c.in    2014-02-12 10:26:18.885579447 +0100
+++ siplib.in.new    2014-02-12 10:30:59.263560644 +0100
@@ -9367,6 +9367,7 @@
     {
         PyObject *mro = ((PyTypeObject *)self)->tp_mro;
         PyObject *base;
+        PyTypeObject *solid;
         int i, n = PyTuple_GET_SIZE(mro);

         /*
@@ -9385,6 +9386,15 @@
                     break;
             }
         }
+        solid = (PyTypeObject *) base;
+        for (; i < n; i++) {
+            base = PyTuple_GET_ITEM(mro, i);
+            if (!PyType_IsSubtype(solid, (PyTypeObject *) base)) {
+                PyErr_Format(PyExc_TypeError,
+                             "multiple C++ base classes are illegal");
+                return -1;
+            }
+        }
     }
     else
     {

[Attachment #5 (text/html)]

<div dir="ltr"><div><div><div class="gmail_quote"><div class="">Hi Phil, Hi Baz, Hi \
List,<br>

<br></div>
</div>I just wrote a patch as advertised earlier, which checks that \
the<br>inheritance is correct and that noone attempts to inherit from more<br>than \
one PyQt base class. It is based on the patch sent earlier.<br></div> Maybe this is \
an improvement enough to put my patches \
in?<br><br>Greetings<br><br>Martin<br><br></div>Patch follows:<br><br>--- <a \
href="http://siplib.c.in">siplib.c.in</a>    2014-02-12 10:26:18.885579447 \
+0100<br>+++ siplib.in.new    2014-02-12 10:30:59.263560644 +0100<br> @@ -9367,6 \
+9367,7 @@<br>     {<br>         PyObject *mro = ((PyTypeObject \
*)self)-&gt;tp_mro;<br>         PyObject *base;<br>+        PyTypeObject *solid;<br>  \
int i, n = PyTuple_GET_SIZE(mro);<br> <br>         /*<br> @@ -9385,6 +9386,15 @@<br>  \
break;<br>             }<br>         }<br>+        solid = (PyTypeObject *) \
base;<br>+        for (; i &lt; n; i++) {<br>+            base = \
PyTuple_GET_ITEM(mro, i);<br>+            if (!PyType_IsSubtype(solid, (PyTypeObject \
*) base)) {<br> +                PyErr_Format(PyExc_TypeError,<br>+                   \
&quot;multiple C++ base classes are illegal&quot;);<br>+                return \
-1;<br>+            }<br>+        }<br>     }<br>     else<br>  {<br></div>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic