In theory we should do this for everything like this;
it provides some type checking and prevents passing the wrong type of value
(though I don't recall this ever happening).
Note: you can't parse_int() directly into an enum.
You have to parse into an int, then cast to enum.
Note 2: there's some funky perl code that scrapes common_defs.h
for #defines and makes them into python variables.
I think we can get rid of this.
Also added some comments.
No functional changes.