I'm stuck dealing with strings which is a pain when porting code...
I'm doing stuff such as porting this:
enum { VAL_NULL = 0, VAL_INT, VAL_FLOAT, VAL_STR, VAL_ANY, VAL_CODE, VAL_MACRO, VAL_IDENT };
to this:
for i,v in enumerate([
'VAL_NULL','VAL_INT','VAL_FLOAT','VAL_STR','VAL_ANY','VAL_CODE','VAL_MACRO','VAL_IDENT'
]): globals()[v]=i
anyone know of a method I could use to enumerate globals w/o pasting the varnames twice or using strings??
thanks :)