After reassigning a local attribute, that attribute seems to be deleted, which may lead to segfaults. Please see the following minimal example:
#!/usr/bin/env python3
from PySide.QtCore import QObject
def modify(klass):
klass.my_list = [3.14] + klass.my_list
return klass
#@modify
class A(QObject):
my_list = ["a"]
print(A().my_list)
AA = modify(A)
print(A().my_list)
print(AA().my_list)
For me, the output is:
$ ./pyside_test.py ['a'] [<NULL>] Segmentation fault
At least the [<NULL>] result also appears for this modification of A:
A.my_list = [3.14] + A.my_list