One cannot assign to Class.__dict__, that is not a 'real' dictionnary... Thanks to @JacquesLucke for noting the issue.