pylint-bot / test

0 stars 0 forks source link

Build real AST for Enum #230

Closed pylint-bot closed 8 years ago

pylint-bot commented 8 years ago

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.


pylint-bot commented 8 years ago

Original comment by BitBucket: ceridwenv, GitHub: @ceridwen?:


Mock ASTs for enums finished in 2591dc9.