tags:

views:

15

answers:

1

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?

+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