Add test for __dict__ attribute on functions.
Merge branch 'master' into python3