why not just using the locals() dictionnary? that would be cleaner than going down to using currentframe(). common_shape could do the very same on the locals dict.