Originally reported by: BitBucket: ceridwenv, GitHub: @ceridwen?
At the moment, the _stdlib enum builder is creating an AST filled with EmptyNodes and inserting base_type, which is a full tree with a ClassDef root, into class_node's bases attribute. Normally bases will never contain anything other than a sequence of Name nodes, and it's impossible to define an AST that looks like that in code because you can't put a statement as an argument to a class's bases. I plan to replace this with a small properly formed AST with a separate ClassDef node for the metaclass, a Name node referring to it, and a mock __init__ function.
Originally reported by: BitBucket: ceridwenv, GitHub: @ceridwen?
At the moment, the _stdlib enum builder is creating an AST filled with EmptyNodes and inserting base_type, which is a full tree with a ClassDef root, into class_node's bases attribute. Normally bases will never contain anything other than a sequence of Name nodes, and it's impossible to define an AST that looks like that in code because you can't put a statement as an argument to a class's bases. I plan to replace this with a small properly formed AST with a separate ClassDef node for the metaclass, a Name node referring to it, and a mock
__init__
function.