Have you attempted the __name__ attribute of the class? ie type(x).__name__ will give you the name of the class, which I believe is the thing that you need.
>>> import itertools
>>> x = itertools.count(0)
>>> type(x).__name__
'count'
In case you're actually utilizing Python 2, note that the above strategy works with new-style classes just (in Python 3+ all classes are "new-style" classes). Your program may utilize some old-style classes. The accompanying works for both:
x.__class__.__name__
Wanna become a python expert? Come and join the python certification course and get certified.