Pipe in the "return" statement

Christian Heimes lists at cheimes.de
Mon Jul 25 14:33:19 CEST 2011


Am 25.07.2011 14:00, schrieb Archard Lias:
> def flags(self, index):
>     if not index.isValid():
>         return Qt.ItemIsEnabled
> 
>     return super(self.__class__, self).flags(index) |

Your use of super() is incorrect and will not work as you might expect.
You *must* use the class here, never self.__class__.

Christian




More information about the Python-list mailing list