don't generate __init__ method for extern classs if it's not used (closes #3050)