I want to use a generator as the argument passed by a PyQt4 signal, and I am not sure as to the cleanest way. I could just do something like elementChosen=QtCore.pyqtSignal(type((i for i in xrange (i))))
, but this just looks ugly. Any suggestions?
views:
15answers:
1
+1
A:
You can use the types
module to make the code look less ugly.
from types import GeneratorType
elementChosen = QtCore.pyqtSignal(GeneratorType)
documentation: http://docs.python.org/library/types.html
PreludeAndFugue
2010-04-07 09:25:32