You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make ClassDef.metaclass an Expression instead of str #3847
Currently the metaclass node is assumed to be a string. This is inconsistent, requires workarounds such as passing '<error>' from the parser to the semantic analysis phase, and makes it awkward to handle metaclasses that come from different contexts (as in python2).
Making it an Expression works cleanly as far as I can tell, and reduces code duplication.
Activity
ilevkivskyi commentedon Aug 19, 2017
Makes sense to me. But what are arguments in favour of strings, why metaclasses are implemented like this?
elazarg commentedon Aug 19, 2017
It was introduced in this commit from 2013. I guess making it an expression at that time was too general.
Make ClassDef.metaclass an Expression (#3848)