Fix #786: generator method fails with callable instance
Merge pull request #787 from AntoineD/master

Fix #786: generator method fails with callable instance