Use expr.func instead of expr.__class__ in expand
Merge pull request #2454 from asmeurer/expand_expr.func

Use expr.func instead of expr.__class__ in expand