what you have is a totally acceptable factory system. Not sure why you are using a generator, but that's another matter.
I agree with the previous replies regarding inheritance... this is not a case for inheritance. You could, however, have Bar be a borg with the Bar factory built in as a class method to the Bar class itself if you want the whole job done by one component. Questions to lead to or away from that: will Engine every create things besides Bars? -- http://mail.python.org/mailman/listinfo/python-list